Image Segmentation
ONNX
BiRefNet
onnxruntime
background-removal
browser
clip-art
print-on-demand
t-shirt-design
knowledge-distillation
Instructions to use bowespublishing/crisp-cut with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use bowespublishing/crisp-cut with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("bowespublishing/crisp-cut", trust_remote_code=True)# Option 2: use with BiRefNet # Install from https://github.com/ZhengPeng7/BiRefNet from models.birefnet import BiRefNet model = BiRefNet.from_pretrained("bowespublishing/crisp-cut") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,6 +8,8 @@ tags:
|
|
| 8 |
- clip-art
|
| 9 |
- print-on-demand
|
| 10 |
- t-shirt-design
|
|
|
|
|
|
|
| 11 |
library_name: onnxruntime
|
| 12 |
pipeline_tag: image-segmentation
|
| 13 |
---
|
|
@@ -16,23 +18,33 @@ pipeline_tag: image-segmentation
|
|
| 16 |
|
| 17 |
**Purpose-built background removal for clip art, t-shirt designs, and print-on-demand assets.**
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
## Models
|
| 22 |
|
| 23 |
-
| File |
|
| 24 |
-
|------|-----------
|
| 25 |
-
| `onnx/crispcut-fast.onnx` |
|
| 26 |
-
| `onnx/crispcut-quality.onnx` |
|
| 27 |
|
| 28 |
Both models:
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
- ONNX opset 17
|
| 32 |
- ImageNet normalisation (mean: `[0.485, 0.456, 0.406]`, std: `[0.229, 0.224, 0.225]`)
|
| 33 |
- Single input tensor: `input` β shape `[1, 3, 1024, 1024]` (NCHW, float32)
|
| 34 |
- Single output tensor: `output` β shape `[1, 1, 1024, 1024]` (logits β apply sigmoid)
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
## Usage with the npm package
|
| 37 |
|
| 38 |
```bash
|
|
@@ -65,11 +77,13 @@ cut(image, { modelUrl: '/models/crispcut-fast.onnx' });
|
|
| 65 |
|
| 66 |
## Training Details
|
| 67 |
|
|
|
|
|
|
|
| 68 |
- **Dataset:** Design-specific content (clip art, illustrations, t-shirt graphics, POD assets)
|
| 69 |
- **Resolution:** 1024Γ1024
|
| 70 |
-
- **
|
| 71 |
-
- **
|
| 72 |
-
- **
|
| 73 |
|
| 74 |
## License
|
| 75 |
|
|
|
|
| 8 |
- clip-art
|
| 9 |
- print-on-demand
|
| 10 |
- t-shirt-design
|
| 11 |
+
- birefnet
|
| 12 |
+
- knowledge-distillation
|
| 13 |
library_name: onnxruntime
|
| 14 |
pipeline_tag: image-segmentation
|
| 15 |
---
|
|
|
|
| 18 |
|
| 19 |
**Purpose-built background removal for clip art, t-shirt designs, and print-on-demand assets.**
|
| 20 |
|
| 21 |
+
Distilled from [**BiRefNet**](https://github.com/ZhengPeng7/BiRefNet) (220 M params β 6.6 M params) with **~95 % quality retention**. Exported as ONNX for browser deployment via [ONNX Runtime Web](https://onnxruntime.ai/).
|
| 22 |
|
| 23 |
## Models
|
| 24 |
|
| 25 |
+
| File | Precision | Size | WASM (CPU) | WebGL (GPU) |
|
| 26 |
+
|------|-----------|------|------------|-------------|
|
| 27 |
+
| `onnx/crispcut-fast.onnx` | INT8 quantized | **6.5 MB** | ~5β10 s | ~1β2 s |
|
| 28 |
+
| `onnx/crispcut-quality.onnx` | FP32 | **25.3 MB** | ~15β25 s | ~3β6 s |
|
| 29 |
|
| 30 |
Both models:
|
| 31 |
+
- **Architecture:** MobileNetV2 + UNet (distilled from BiRefNet)
|
| 32 |
+
- **Trained at 1024Γ1024** on design-specific content
|
| 33 |
- ONNX opset 17
|
| 34 |
- ImageNet normalisation (mean: `[0.485, 0.456, 0.406]`, std: `[0.229, 0.224, 0.225]`)
|
| 35 |
- Single input tensor: `input` β shape `[1, 3, 1024, 1024]` (NCHW, float32)
|
| 36 |
- Single output tensor: `output` β shape `[1, 1, 1024, 1024]` (logits β apply sigmoid)
|
| 37 |
|
| 38 |
+
## Distillation Details
|
| 39 |
+
|
| 40 |
+
| | Teacher (BiRefNet) | Student (CrispCut) |
|
| 41 |
+
|---|---|---|
|
| 42 |
+
| Parameters | 220 M | 6.6 M |
|
| 43 |
+
| Compression | β | **33Γ smaller** |
|
| 44 |
+
| Quality | 100 % | ~95 % |
|
| 45 |
+
|
| 46 |
+
The student model uses a MobileNetV2 encoder with a UNet decoder, trained via knowledge distillation from the full BiRefNet teacher on design-specific data.
|
| 47 |
+
|
| 48 |
## Usage with the npm package
|
| 49 |
|
| 50 |
```bash
|
|
|
|
| 77 |
|
| 78 |
## Training Details
|
| 79 |
|
| 80 |
+
- **Teacher:** BiRefNet (220 M parameters)
|
| 81 |
+
- **Student:** MobileNetV2 + UNet (6.6 M parameters)
|
| 82 |
- **Dataset:** Design-specific content (clip art, illustrations, t-shirt graphics, POD assets)
|
| 83 |
- **Resolution:** 1024Γ1024
|
| 84 |
+
- **Distillation method:** Knowledge distillation with feature-level and output-level supervision
|
| 85 |
+
- **Fast model:** INT8 dynamic quantization (via ONNX Runtime)
|
| 86 |
+
- **Quality model:** Full FP32 precision
|
| 87 |
|
| 88 |
## License
|
| 89 |
|