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
Downloads last month
56
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for onnx-community/BEN2-ONNX

Base model

PramaLLC/BEN2
Quantized
(1)
this model