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
|
@@ -36,21 +36,18 @@ Both models:
|
|
| 36 |
## Usage with the npm package
|
| 37 |
|
| 38 |
```bash
|
| 39 |
-
npm
|
| 40 |
```
|
| 41 |
|
| 42 |
```js
|
| 43 |
-
import {
|
| 44 |
|
| 45 |
// Fast mode (default) — downloads crispcut-fast.onnx from this repo
|
| 46 |
-
const result = await
|
| 47 |
img.src = result.url;
|
| 48 |
|
| 49 |
// Quality mode with GPU
|
| 50 |
-
const result = await
|
| 51 |
-
quality: 'quality',
|
| 52 |
-
executionProvider: 'webgl',
|
| 53 |
-
});
|
| 54 |
```
|
| 55 |
|
| 56 |
Models are fetched automatically from this repo at runtime. No server needed — everything runs in the browser.
|
|
@@ -63,9 +60,7 @@ Models are fetched automatically from this repo at runtime. No server needed —
|
|
| 63 |
Download the `.onnx` files from the `onnx/` folder and serve them from your own CDN:
|
| 64 |
|
| 65 |
```js
|
| 66 |
-
|
| 67 |
-
modelUrl: '/models/crispcut-fast.onnx',
|
| 68 |
-
});
|
| 69 |
```
|
| 70 |
|
| 71 |
## Training Details
|
|
|
|
| 36 |
## Usage with the npm package
|
| 37 |
|
| 38 |
```bash
|
| 39 |
+
npm i @crispcut/background-removal
|
| 40 |
```
|
| 41 |
|
| 42 |
```js
|
| 43 |
+
import { cut } from '@crispcut/background-removal';
|
| 44 |
|
| 45 |
// Fast mode (default) — downloads crispcut-fast.onnx from this repo
|
| 46 |
+
const result = await cut(image);
|
| 47 |
img.src = result.url;
|
| 48 |
|
| 49 |
// Quality mode with GPU
|
| 50 |
+
const result = await cut(image, { model: 'quality', gpu: true });
|
|
|
|
|
|
|
|
|
|
| 51 |
```
|
| 52 |
|
| 53 |
Models are fetched automatically from this repo at runtime. No server needed — everything runs in the browser.
|
|
|
|
| 60 |
Download the `.onnx` files from the `onnx/` folder and serve them from your own CDN:
|
| 61 |
|
| 62 |
```js
|
| 63 |
+
cut(image, { modelUrl: '/models/crispcut-fast.onnx' });
|
|
|
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
## Training Details
|