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
| { | |
| "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 | |
| } | |
| } | |