Practical overview
When it fits
Use it when a fashion or virtual try-on workflow needs human regions identified in images before later analysis or processing.
Who it is for
- Developers building fashion-image analysis workflows
- Teams incorporating human-region parsing into virtual try-on pipelines
- Python users who need segmentation masks or raw logits from fashion imagery
Documented uses
- Produce a pixel-level label map for clothing, body and accessory regions.
- Supply parsed regions as input to downstream fashion or virtual try-on processing.
- Process multiple images in a batch or request raw model logits.
Requirements & limits
The documented Python package installs with pip. Model weights are downloaded from Hugging Face Hub on first use and cached locally. A Hugging Face pipeline is also documented.
- The model defines 18 classes, including background, body parts, garments and accessories.
- The Python package uses training-aligned OpenCV INTER_AREA preprocessing; the Hugging Face pipeline uses PIL LANCZOS and may produce slightly different outputs.
- NumPy inputs must be RGB; OpenCV images require BGR-to-RGB conversion.
- The package returns one class-ID map, while the Hugging Face pipeline returns per-class masks.
- The repository states that the model inherits the NVIDIA Source Code License for SegFormer.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install the Python package and prepare for inference
Set up the documented package so it can load the parser and its model weights.
Before you start
- Python environment with pip
- Internet access on first use to download the approximately 244 MB model weights from Hugging Face Hub
Steps
Install the package with the command below.
pip install fashn-human-parserIn Python, import
FashnHumanParserfromfashn_human_parser.Create a parser with
FashnHumanParser(); weights download automatically on first use and are cached locally.
Expected outcome
The parser is initialized and model weights are available in the local Hugging Face cache.
Guide limitations
- This setup guide does not cover prediction or downstream integration.
- The package license inherits the NVIDIA Source Code License for SegFormer; review its terms.
Generate a segmentation map from an image
Use the initialized Python parser to obtain the documented 18-class label map for one image.
Before you start
- Installed
fashn-human-parserpackage and initializedFashnHumanParserinstance - An image supplied as a file path, PIL Image or NumPy array
- NumPy arrays must use RGB channel order
Steps
Pass an image to
parser.predict(image).For a NumPy image read by OpenCV, convert it from BGR to RGB before prediction.
Use the returned NumPy array of shape
(H, W); values 0–17 represent the semantic classes.
Expected outcome
A segmentation map matching the input dimensions, with pixel values identifying the 18 classes.
Guide limitations
- The model’s documented input size is 384 × 576.
- The guide covers inference on an image, not evaluation quality or integration into a complete virtual try-on system.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 18 October 2026
- Original website title
- fashn-AI/fashn-human-parser · Official homepage title · retained in its source language

