Views
No views yet
| Variant | Size | Dtype | WebGPU |
|---|---|---|---|
| Original (fp32) | 168 MB | fp32 | ✅ |
| This version (QDQ) | 42 MB | int8 (weight-only) | ✅ |
1import { pipeline } from '@huggingface/transformers';
2
3const segmenter = await pipeline('background-removal', 'xrds/isnet-general-onnx-int8', {
4 device: 'webgpu',
5 dtype: 'q8',
6});
7const result = await segmenter('image.jpg');convert_weight_only_qdq.py to convert any Conv-based ONNX model to weight-only QDQ:1pip install onnx onnxruntime numpy
2
3# Convert fp32 model → weight-only QDQ
4python convert_weight_only_qdq.py --input model.onnx --output model-qdq.onnx
5
6# Or with defaults (uses isnet-general-use.onnx → isnet-general-use-weight-only-qdq.onnx)
7python convert_weight_only_qdq.py