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")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BritishWerewolf/U-2-Net", dtype="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
File size: 438 Bytes
614b52f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {
"processor_class": "U2NetProcessor",
"image_processor_type": "U2NetImageProcessor",
"do_convert_rgb": true,
"do_normalize": true,
"do_pad": true,
"do_rescale": true,
"do_resize": true,
"keep_aspect_ratio": true,
"image_mean": [
0.485,
0.456,
0.406
],
"image_std": [
0.229,
0.224,
0.225
],
"pad_size": {
"width": 320,
"height": 320
},
"size": {
"longest_edge": 320
}
}
|