Image Segmentation
Transformers
ONNX
Transformers.js
English
u2net
isnet
dis
mask-generation
vision
background-removal
portrait-matting
Instructions to use BritishWerewolf/IS-Net with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BritishWerewolf/IS-Net with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="BritishWerewolf/IS-Net")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BritishWerewolf/IS-Net", device_map="auto") - Transformers.js
How to use BritishWerewolf/IS-Net with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'BritishWerewolf/IS-Net'); - Notebooks
- Google Colab
- Kaggle
Download preprocessor_config.json from BritishWerewolf/IS-Net: direct link, hf CLI and curl.
- Browser
- Download file 435 Bytes
-
https://huggingface.co/BritishWerewolf/IS-Net/resolve/main/preprocessor_config.json
- Command line
-
hf download hf://BritishWerewolf/IS-Net/preprocessor_config.json
-
curl -L -o preprocessor_config.json https://huggingface.co/BritishWerewolf/IS-Net/resolve/main/preprocessor_config.json
435 Bytes
| { | |
| "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": [ | |
| 1.0, | |
| 1.0, | |
| 1.0 | |
| ], | |
| "pad_size": { | |
| "width": 1024, | |
| "height": 1024 | |
| }, | |
| "size": { | |
| "longest_edge": 1024 | |
| } | |
| } | |