Releases: WuChenDi/MODNet
Releases · WuChenDi/MODNet
Release list
v1.0.0
First tagged release. Self-contained ONNX export/inference pipeline running on current PyTorch 2.x, plus a Transformers.js example on the latest majors.
Highlights
- Self-contained ONNX pipeline — the MobileNetV2 backbone from upstream ZHKKKe/MODNet (Apache-2.0) is vendored under
src/, so export/inference no longer require the upstream repo checked out. - PyTorch 2.x support — runs on
torch>=2.12with CPU fallback; addsonnxscript(required by the 2.x exporter) and pins the legacy exporter (dynamo=False) so weights are embedded correctly (~25 MB) anddynamic_axesis honored. - Dropped SwanLab — the export/inference scripts use plain
print; no mandatory account or network dependency. - Transformers.js v4 —
examples/upgraded to@huggingface/transformers4 andtypescript6 (example code unchanged, type-checks clean).
Python / ONNX tooling (onnx_tools/)
- CPU fallback and DataParallel-prefix stripping in
export_onnx.py;--opset-versionflag (default 17). torch.loadhardened withmap_location+weights_only=True.inference_onnx.py: explicitCPUExecutionProvider, clearer tensor layout, required path args.- Renamed
onnx/->onnx_tools/to stop the local package from shadowing the installedonnxlibrary.
Dependencies
- Python:
torch>=2.12,torchvision>=0.27,onnxruntime>=1.23.2,numpy>=2.2, latestonnx/opencv/pillow, addonnxscript, dropswanlab. - JS/TS:
@huggingface/transformers3 -> 4,typescript5 -> 6,tsxupdated.
Docs
- Rewritten
onnx_tools/README.md(virtualenv + install steps, argument tables, "Notes for PyTorch 2.x export"). - Root
README.mdentry point with a contents table and upstream credit;src/README.mdattribution.
Verification
End-to-end export + inference on CPU: exported model ~24.76 MB (full weights), inference produces a valid alpha matte.