Add model card README
Browse files
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: onnx
|
| 4 |
+
tags:
|
| 5 |
+
- image-segmentation
|
| 6 |
+
- face-parsing
|
| 7 |
+
- portrait-segmentation
|
| 8 |
+
- onnx
|
| 9 |
+
- comfyui
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# EasyPortrait ONNX
|
| 13 |
+
|
| 14 |
+
ONNX exports of the pretrained EasyPortrait portrait segmentation and face parsing checkpoints.
|
| 15 |
+
|
| 16 |
+
The original checkpoints and training code were published by the EasyPortrait authors in [hukenovs/easyportrait](https://github.com/hukenovs/easyportrait). This repository exists to make the models easier to use in modern runtimes, especially ComfyUI environments where installing the old `mmsegmentation` / `mmcv-full` stack can be slow or fragile.
|
| 17 |
+
|
| 18 |
+
## Files
|
| 19 |
+
|
| 20 |
+
This repository contains 26 validated ONNX models and a `manifest.json`.
|
| 21 |
+
|
| 22 |
+
Model families:
|
| 23 |
+
|
| 24 |
+
- Portrait segmentation:
|
| 25 |
+
- BiSeNet-V2
|
| 26 |
+
- DANet
|
| 27 |
+
- DeepLabV3
|
| 28 |
+
- FastSCNN
|
| 29 |
+
- FCN + MobileNetV2
|
| 30 |
+
- FPN + ResNet50 at 224, 384, 512, and 1024
|
| 31 |
+
- SegFormer-B0 at 224, 384, 512, and 1024
|
| 32 |
+
- Face parsing:
|
| 33 |
+
- BiSeNet-V2
|
| 34 |
+
- DANet
|
| 35 |
+
- DeepLabV3
|
| 36 |
+
- FastSCNN
|
| 37 |
+
- FCN + MobileNetV2
|
| 38 |
+
- FPN + ResNet50 at 224, 384, 512, and 1024
|
| 39 |
+
- SegFormer-B0 at 224, 384, 512, and 1024
|
| 40 |
+
|
| 41 |
+
Three upstream README-only checkpoints are not included because they do not include enough model config metadata for reliable conversion: `extremec3net_ps`, `sinet_ps`, and `ehanet_fp`.
|
| 42 |
+
|
| 43 |
+
## Input And Output
|
| 44 |
+
|
| 45 |
+
Each model expects a normalized tensor:
|
| 46 |
+
|
| 47 |
+
- Input name: `image`
|
| 48 |
+
- Input shape: `[batch, 3, model_size, model_size]`
|
| 49 |
+
- Input dtype: `float32`
|
| 50 |
+
- Channel order before normalization: BGR
|
| 51 |
+
- Mean: `[143.55267075, 132.96705975, 126.94924335]`
|
| 52 |
+
- Std: `[60.2625333, 60.32740275, 59.30988645]`
|
| 53 |
+
|
| 54 |
+
Each model returns logits:
|
| 55 |
+
|
| 56 |
+
- Output name: `logits`
|
| 57 |
+
- Output shape: `[batch, classes, model_size, model_size]`
|
| 58 |
+
- Output dtype: `float32`
|
| 59 |
+
|
| 60 |
+
Use `argmax(axis=1)` to get the segmentation class map.
|
| 61 |
+
|
| 62 |
+
Labels:
|
| 63 |
+
|
| 64 |
+
- Portrait segmentation: `background`, `person`
|
| 65 |
+
- Face parsing: `background`, `skin`, `left brow`, `right brow`, `left eye`, `right eye`, `lips`, `teeth`
|
| 66 |
+
|
| 67 |
+
## Validation
|
| 68 |
+
|
| 69 |
+
The ONNX models were exported from the original PyTorch/mmseg checkpoints and validated with ONNX Runtime against the PyTorch/mmseg output. The validation compares logits and verifies that the final `argmax` segmentation agrees.
|
| 70 |
+
|
| 71 |
+
See `manifest.json` for per-model metadata and validation values.
|
| 72 |
+
|
| 73 |
+
## ComfyUI
|
| 74 |
+
|
| 75 |
+
These files are used by the ComfyUI custom node:
|
| 76 |
+
|
| 77 |
+
[ComfyUI-EasyPortrait](https://github.com/sadzip/ComfyUI-EasyPortrait)
|
| 78 |
+
|
| 79 |
+
The node downloads models from this repository on first use.
|
| 80 |
+
|
| 81 |
+
## Credits
|
| 82 |
+
|
| 83 |
+
Thanks to the EasyPortrait authors for training and releasing the original models:
|
| 84 |
+
|
| 85 |
+
- Original repository: [hukenovs/easyportrait](https://github.com/hukenovs/easyportrait)
|
| 86 |
+
|
| 87 |
+
Co-authors of this ONNX conversion and ComfyUI integration:
|
| 88 |
+
|
| 89 |
+
- sadzip
|
| 90 |
+
- OpenAI Codex
|