Instructions to use Saimon8420/ormbg-web with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Saimon8420/ormbg-web with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'Saimon8420/ormbg-web');
|
Download README.md from Saimon8420/ormbg-web: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/Saimon8420/ormbg-web/resolve/main/README.md
- Command line
-
hf download hf://Saimon8420/ormbg-web/README.md
-
curl -L -o README.md https://huggingface.co/Saimon8420/ormbg-web/resolve/main/README.md
1.52 kB
| license: apache-2.0 | |
| library_name: transformers.js | |
| pipeline_tag: image-segmentation | |
| tags: | |
| - background-removal | |
| - onnx | |
| - onnxruntime-web | |
| - webgpu | |
| base_model: onnx-community/ormbg-ONNX | |
| # ORMBG — compact web build (44 MB) | |
| A compact build of **ORMBG** (Open Remove Background Model, by schirrmacher) for fast in-browser background removal | |
| with [Transformers.js](https://huggingface.co/docs/transformers.js) / onnxruntime-web. | |
| Used by the free [Doetra Background Remover](https://doetra.com). | |
| ## What changed vs. `onnx-community/ormbg-ONNX` | |
| - Graph upgraded from opset 11 to opset 17. | |
| - **int8 per-channel weights** (`DequantizeLinear`) for convolutions, fp16 for the remaining large tensors, **fp32 | |
| compute** — 44 MB instead of 176 MB. Mask difference vs. fp32: mean 0.2/255, 99.93%+ identical after thresholding. | |
| - Runs on WebGPU without `shader-f16` support. | |
| ## Usage | |
| ```js | |
| import { AutoModel, AutoProcessor } from '@huggingface/transformers' | |
| const model = await AutoModel.from_pretrained('Saimon8420/ormbg-web', { dtype: 'fp32', device: 'webgpu' }) | |
| const processor = await AutoProcessor.from_pretrained('Saimon8420/ormbg-web') | |
| ``` | |
| Input `pixel_values` `[1, 3, 1024, 1024]` in `[0, 1]`; output `alphas` `[1, 1, 1024, 1024]` in `[0, 1]`. | |
| ## Credits & license | |
| - **ORMBG** by Maximilian Schirrmacher — https://github.com/schirrmacher/ormbg (Apache-2.0); ONNX by | |
| [onnx-community](https://huggingface.co/onnx-community/ormbg-ONNX). | |
| - Redistributed under the same **Apache-2.0** license. | |