Trimap-Free Portrait Matting in Real Time
ONNX export/inference tooling and a Transformers.js example for the MODNet portrait matting model.
Derived from the official ZHKKKe/MODNet repository. The original work is by its authors; this repository adds ONNX export/inference scripts and a Transformers.js usage example on top of it.
| Path | Description |
|---|---|
onnx_tools/ |
Export a MODNet checkpoint to ONNX and run inference with ONNX Runtime |
examples/ |
Portrait matting in JS/TS via @huggingface/transformers |
pretrained/ |
Location for downloaded pre-trained models |
src/ |
MobileNetV2 backbone vendored from upstream MODNet (used by the ONNX pipeline) |
- Web / Node.js — see
examples/to run matting with Transformers.js. - Python / ONNX — see
onnx_tools/to export a checkpoint and run ONNX Runtime inference.