Instructions to use xrds/isnet-general-onnx-int8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use xrds/isnet-general-onnx-int8 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'xrds/isnet-general-onnx-int8');
ISNet General Use β Weight-only QDQ (INT8)
INT8 quantized version of imgly/isnet-general-onnx using weight-only QDQ format.
Model Details
| Variant | Size | Dtype | WebGPU |
|---|---|---|---|
| Original (fp32) | 168 MB | fp32 | β |
| This version (QDQ) | 42 MB | int8 (weight-only) | β |
Why weight-only QDQ?
Standard QDQ quantization quantizes both weights and activations, causing accuracy loss (faded colors). Weight-only QDQ only quantizes Conv weights while keeping activations in fp32 β preserving output quality identical to the fp32 model while achieving 75% size reduction and full WebGPU support.
Usage with Transformers.js
import { pipeline } from '@huggingface/transformers';
const segmenter = await pipeline('background-removal', 'xrds/isnet-general-onnx-int8', {
device: 'webgpu',
dtype: 'q8',
});
const result = await segmenter('image.jpg');
Convert your own model
Use the included convert_weight_only_qdq.py to convert any Conv-based ONNX model to weight-only QDQ:
pip install onnx onnxruntime numpy
# Convert fp32 model β weight-only QDQ
python convert_weight_only_qdq.py --input model.onnx --output model-qdq.onnx
# Or with defaults (uses isnet-general-use.onnx β isnet-general-use-weight-only-qdq.onnx)
python convert_weight_only_qdq.py
The script quantizes only Conv weights to int8 (per-tensor symmetric), leaving activations in fp32. Output is a standard QDQ-format ONNX model compatible with WebGPU execution providers.
License
MIT β same as the original imgly/isnet-general-onnx model.
- Downloads last month
- 407
Model tree for xrds/isnet-general-onnx-int8
Base model
imgly/isnet-general-onnx