Instructions to use faisal-shohag/fashn-human-parser-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use faisal-shohag/fashn-human-parser-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'faisal-shohag/fashn-human-parser-onnx');
FASHN Human Parser (ONNX, transformers.js)
ONNX export of fashn-ai/fashn-human-parser (SegFormer-B4, 18 classes, 384×576 input) for in-browser use with Transformers.js.
| File | Precision | Size | Pixel agreement vs. PyTorch* |
|---|---|---|---|
onnx/model.onnx |
fp32 | 257 MB | 99.86% |
onnx/model_fp16.onnx |
fp16 (fp32 I/O) | 130 MB | 99.86% |
onnx/model_quantized.onnx |
int8 dynamic | 67 MB | 99.78% |
* Argmax label map compared with FashnHumanParser.predict on the example images from the FASHN VTON repo.
Exported with optimum (opset 17); fp16 via onnxconverter-common; int8 via onnxruntime.quantization.quantize_dynamic.
Usage
import { pipeline } from "@huggingface/transformers";
const parser = await pipeline("image-segmentation", "faisal-shohag/fashn-human-parser-onnx", { dtype: "q8" });
const segments = await parser("person.jpg"); // [{ label: "top", mask: RawImage }, ...]
Labels: background, face, hair, top, dress, skirt, pants, belt, bag, hat, scarf, glasses, arms, hands, legs, feet, torso, jewelry.
License
Inherits the NVIDIA Source Code License for SegFormer from the original model: non-commercial use only. All credit for the model goes to FASHN AI.
- Downloads last month
- 12
Model tree for faisal-shohag/fashn-human-parser-onnx
Base model
fashn-ai/fashn-human-parser