Instructions to use Orangebot/ormbg-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Orangebot/ormbg-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'Orangebot/ormbg-ONNX');
ormbg-ONNX (Orangebot mirror)
ONNX weights of ormbg, an open background-removal model based on IS-Net, for running in the browser with Transformers.js.
This repo powers the free, in-browser Background Remover on orangebot.ai: photos are processed on the visitor's device and never uploaded.
Source and changes
- Files are copied unchanged from
onnx-community/ormbg-ONNXat revision034e2d884afbab897e10e78fc5bb566b29533fd6, which convertsschirrmacher/ormbgto ONNX. - Only two precisions are kept:
onnx/model_fp16.onnx(WebGPU withshader-f16) andonnx/model_uint8.onnx(WebAssembly / CPU). Other quantized variants were left out. - No weights were modified. Credit for the model goes to its author (schirrmacher); credit for the ONNX conversion goes to the ONNX Community.
Usage (Transformers.js)
import { pipeline } from '@huggingface/transformers';
const remover = await pipeline('background-removal', 'Orangebot/ormbg-ONNX', {
device: 'webgpu', // or 'wasm'
dtype: 'fp16', // use 'uint8' with 'wasm'
});
const [result] = await remover('photo.jpg');
// result is a RawImage with the background made transparent
Limitations
The upstream author describes ormbg as optimized for images with humans. Products, pets, fine hair against busy backgrounds and transparent objects (glass) may give weaker cut-outs.
License
Apache License 2.0, the same as the upstream model; see LICENSE.
- Downloads last month
- 15
Model tree for Orangebot/ormbg-ONNX
Base model
schirrmacher/ormbg