Image Segmentation
Transformers
ONNX
Transformers.js
English
u2net
mask-generation
vision
background-removal
portrait-matting
Instructions to use BritishWerewolf/U-2-Net with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BritishWerewolf/U-2-Net with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="BritishWerewolf/U-2-Net")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BritishWerewolf/U-2-Net", device_map="auto") - Transformers.js
How to use BritishWerewolf/U-2-Net with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'BritishWerewolf/U-2-Net'); - Notebooks
- Google Colab
- Kaggle
Commit ·
c08042b
1
Parent(s): c52cd2b
Set default model to fp32.
Browse files- config.json +3 -0
config.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
| 4 |
"architectures": [
|
| 5 |
"U2NetModel"
|
| 6 |
],
|
|
|
|
|
|
|
|
|
|
| 7 |
"input_name": ["input.1"],
|
| 8 |
"input_shape": [1, 3, 320, 320],
|
| 9 |
"output_composite": "1959",
|
|
|
|
| 4 |
"architectures": [
|
| 5 |
"U2NetModel"
|
| 6 |
],
|
| 7 |
+
"transformers.js_config": {
|
| 8 |
+
"dtype": "fp32"
|
| 9 |
+
},
|
| 10 |
"input_name": ["input.1"],
|
| 11 |
"input_shape": [1, 3, 320, 320],
|
| 12 |
"output_composite": "1959",
|