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
Unknown image_processor_type: 'U2NetImageProcessor'.
#1
by vinnichase - opened
Running the model with the latest @huggingface/transformers library in node or in bun gives
Unknown image_processor_type: 'U2NetImageProcessor'.
I copied the example from the model card without modifications
Hey, I really ought to make this private, but I’ve been testing it out recently.
Currently these models are not supported because I am waiting for the custom model and processor to be merged into the library.
You can see the process of the pull request here:
https://github.com/huggingface/transformers.js/pull/1222
If this code is merged into the library, then these models will support the example shown here, as well as the new pipeline usage too!
Apologies for the issues currently!