Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.17 KB

File metadata and controls

28 lines (19 loc) · 1.17 KB

MODNet

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.

Links

Contents

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)

Quick start

  • 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.