onnx-community/ormbg-ONNX

🤗 Hugging Face 来源image-segmentationapache-2.0617 MBother✓ 8 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo onnx-community/ormbg-ONNX ./model-folder
需要做种者 →

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/ormbg-ONNX');
const url = 'https://images.pexels.com/photos/5965592/pexels-photo-5965592.jpeg?auto=compress&cs=tinysrgb&w=1024';
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.