BEN2 ONNX
If you haven't already, you can install the Transformers.js JavaScript library from NPM using: npm i @huggingface/transformers
Source du modèle
- Type
- Other
- Taille du fichier
- 198–209 MB
- Modèle de base
- PramaLLC/BEN2
- Version
- vRevision 75eb62b
- Mis à jour
- 9 oct. 2026
- Téléchargements
- 25
- Source
- Hugging Face
Description de la source
Usage (Transformers.js)
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @huggingface/transformers
Example: Remove background of an image
import { pipeline } from '@huggingface/transformers';
const segmenter = await pipeline('background-removal', 'onnx-community/BEN2-ONNX');
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/woman-with-afro_medium.jpg';
const output = await segmenter(url);
output[0].save('mask.png');
// You can also use `output[0].toCanvas()` or `await output[0].toBlob()` if you would like to access the output without saving.
| Input | Output |
|---|---|
| input | output |
Sources
1 source
Sources
1 sourceVérifié 9 oct.
Artefacts du modèle
4 artefacts
Artefacts du modèle
4 artefactsExtraits de sources
3 extraits
Extraits de sources
3 extraits--- license: mit base_model: - PramaLLC/BEN2 pipeline_tag: image-segmentation library_name: transformers.js tags: - background-removal --- ## Usage (Transformers.js) If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using: ```bash npm i @huggingface/transformers ``` **Example**: Remove background of an image ```js import { pipeline } from '@huggingface/transformers'; const segmenter = await pipeline('background-removal', 'onnx-community/BEN2-ONNX'); const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/woman-with-afro_medium.jpg'; const output = await segmenter(url); output[0].save('mask.png'); // You can also use `output[0].toCanvas()` or `await output[0].toBlob()` if you would like to access the output without saving. ``` | Input| Output | |--------|--------| |  |  |
Source context: 25 downloads · 1 likes · Pipeline image-segmentation · Library transformers.js · Repo square-zero-labs/BEN2-ONNX
Source context: 649 downloads · 0 likes · Pipeline image-segmentation · Library transformers.js · Repo square-zero-labs/BEN2-ONNX
