BEN2 (Background Erase Network) introduces a novel approach to foreground segmentation through its innovative Confidence Guided Matting (CGM) pipeline. The architecture employs a refiner network that targets and processes pixels where the base model exhibits lower confidence levels, resulting in more precise and reliable matting results. This model is built on BEN: BEN2 was trained on the DIS5k and our 22K proprietary segmentation dataset. Our enhanced model delivers superior performance in hair matting, 4K processing, object segmentation, and edge refinement. Our Base model is open source. To try the full model through our free web demo or integrate BEN2 into your project with our API…
Semantic segmentation model fine-tuned from nvidia/mit-b5 with CelebAMask-HQ for face parsing. For additional options, see the Transformers Segformer docs. Exhaustive list of labels can be extracted from config.json.
Runs On
What it takes to serve face-parsing (85M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.
| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
|---|---|---|---|---|---|
| 16-bit | 0.2 GB | 0.2 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 8-bit | 0.1 GB | 0.1 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 4-bit | 0.0 GB | 0.1 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.
Model Card
Semantic segmentation model fine-tuned from nvidia/mit-b5 with CelebAMask-HQ for face parsing. For additional options, see the Transformers Segformer docs. Exhaustive list of labels can be extracted from config.json. Since p5.js uses an animation loop abstraction, we need to take care loading the model and making predictions. While the capabilities of computer vision models are impressive, they can also reinforce or exacerbate social biases. The CelebAMask-HQ dataset used for fine-tuning is large but not necessarily perfectly diverse or representative. Also, they are images of.... just celebrities.
Excerpt from the card by Jonathan Dinu.
Configuration
- Architecture
- SegformerForSemanticSegmentation
- Model type
- segformer
Identity and Version
- Repository
- jonathandinu/face-parsing
- Publisher
- Jonathan Dinu
- Task
- Image segmentation
- Modality
- Image
- Library
- transformers
- Parameters
- 85M parameters
- Languages
- en
- Revision
- 758b82e15a0178c9db39c1ff666a8b56e3a550c8
- First published
- 2022-07-06
- Last updated
- 2026-02-18
Files and Weights
10 files, 1.1 GB in total. The weights are 4 files totalling 1.1 GB in bin, onnx, safetensors.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| model.safetensors | Weights | 338.6 MB | c2bec795a8c2 |
| onnx/model.onnx | Weights | 340.3 MB | 6d4e67af60ff |
| onnx/model_quantized.onnx | Weights | 89.4 MB | 5bab9bfb3cb9 |
| pytorch_model.bin | Weights | 338.8 MB | e0139f52e953 |
| config.json | Configuration | 1.7 KB | — |
| preprocessor_config.json | Configuration | 374 B | — |
| quantize_config.json | Configuration | 749 B | — |
| README.md | Documentation | 5.6 KB | — |
| demo.png | Other | 645.1 KB | — |
| .gitattributes | Repository | 1.2 KB | — |
License and Download
- License
- Not stated by the source
- Access
- Open weights, no gate
- Download size
- 1.1 GB
Released by Jonathan Dinu through its official repository on Hugging Face.
Built From
- Described by arXiv:2105.15203
- Trained on (disclosed) celebamaskhq
Memory Requirements
| Precision | Weights in memory |
|---|---|
| As published | 1.1 GB |
| 16-bit | 0.2 GB |
| 8-bit | 0.1 GB |
| 4-bit | 0.0 GB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
Questions About face-parsing
How much GPU memory does face-parsing need?
About 0.2 GB at 16-bit and 0.1 GB at 4-bit: the weights (85M parameters) plus a working margin. A long context needs more.
What is the cheapest GPU to run face-parsing on?
At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.
Similar Models
Mask2Former model trained on ADE20k semantic segmentation (small-sized version, Swin backbone). It was introduced in the paper Masked-attention Mask Transformer for Universal Image Segmentation and first released in this repository. Disclaimer: The team releasing Mask2Former did not write a model card for this model so this model card has been written by the Hugging Face team. Mask2Former addresses instance, semantic and panoptic segmentation with the same paradigm: by predicting a set of masks and corresponding labels. Hence, all 3 tasks are treated as if they were instance segmentation. Mask2Former outperforms the previous SOTA, MaskFormer both in terms of performance an efficiency by (i)…
Mask2Former model trained on COCO instance segmentation (small-sized version, Swin backbone). It was introduced in the paper Masked-attention Mask Transformer for Universal Image Segmentation and first released in this repository. Disclaimer: The team releasing Mask2Former did not write a model card for this model so this model card has been written by the Hugging Face team. Mask2Former addresses instance, semantic and panoptic segmentation with the same paradigm: by predicting a set of masks and corresponding labels. Hence, all 3 tasks are treated as if they were instance segmentation. Mask2Former outperforms the previous SOTA, MaskFormer both in terms of performance an efficiency by (i)…
A SegFormer-B4 model fine-tuned for human parsing with 18 semantic classes, optimized for fashion and virtual try-on applications. This model segments human images into 18 semantic categories including body parts (face, hair, arms, hands, legs, feet, torso), clothing items (top, dress, skirt, pants, belt, scarf), and accessories (bag, hat, glasses, jewelry). The pipeline automatically manages GPU/CPU and returns per-class masks at the original image resolution. For maximum accuracy, use our Python package which implements the exact preprocessing used during training: The package uses cv2.INTERAREA for resizing (matching training), while the HuggingFace pipeline uses PIL LANCZOS. Labels…
Mask2Former model trained on COCO panoptic segmentation (base-sized version, Swin backbone). It was introduced in the paper Masked-attention Mask Transformer for Universal Image Segmentation and first released in this repository. Disclaimer: The team releasing Mask2Former did not write a model card for this model so this model card has been written by the Hugging Face team. Mask2Former addresses instance, semantic and panoptic segmentation with the same paradigm: by predicting a set of masks and corresponding labels. Hence, all 3 tasks are treated as if they were instance segmentation. Mask2Former outperforms the previous SOTA, MaskFormer both in terms of performance an efficiency by (i)…
Mask2Former model trained on ADE20k semantic segmentation (base-sized version, Swin backbone). It was introduced in the paper Masked-attention Mask Transformer for Universal Image Segmentation and first released in this repository. Disclaimer: The team releasing Mask2Former did not write a model card for this model so this model card has been written by the Hugging Face team. Mask2Former addresses instance, semantic and panoptic segmentation with the same paradigm: by predicting a set of masks and corresponding labels. Hence, all 3 tasks are treated as if they were instance segmentation. Mask2Former outperforms the previous SOTA, MaskFormer both in terms of performance an efficiency by (i)…
