Downloads · 30 days
75
10% of all-time downloads
onnx-community/sapiens-seg-0.3b
sapiens-seg-0.3b is a image segmentation model from onnx-community. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for transformers.js.
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
Downloads · 30 days
75
10% of all-time downloads
All-time downloads
738
Public
Repo size
3.8 GB
Likes
4
Public
Click a slice to open those files.
.onnx4.3 GB · 100%
From the Hugging Face model README
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @huggingface/transformers
Example: Semantic segmentation with onnx-community/sapiens-seg-0.3b.
import { pipeline } from '@huggingface/transformers';
const segmenter = await pipeline('image-segmentation', 'onnx-community/sapiens-seg-0.3b');
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/ryan-gosling.jpg';
const output = await segmenter(url);
console.log(output)
// [
// {
// score: null,
// label: 'Background',
// mask: RawImage { ... }
// },
// {
// score: null,
// label: 'Apparel',
// mask: RawImage { ... }
// },
// ...
// ]
You can visualize the outputs with:
for (const l of output) {
l.mask.save(`${l.label}.png`);
}