Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.0%) to scientific vocabulary
Repository
MODNet in Pytorch and ONNX
Basic Info
Statistics
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Fork of ZHKKKe/MODNet
Differences between original repository and fork:
- Compatibility with PyTorch >=2.5. (🔥)
- Original pretrained models and converted ONNX models from GitHub releases page. (🔥)
- Installation with requirements.txt file.
- ONNX Simplifier integration in the export_onnx.py file.
- Minor modifications in the inference.py file.
- The following deprecations and errors has been fixed:
- FutureWarning: You are using 'torch.load' with 'weights_only=False'.
- AttributeError: module 'onnx' has no attribute 'loadfromstring'.
Installation
shell
pip install -r requirements.txt
Pretrained models
- Download links:
| Name | Model Size (MB) | Link | SHA-256 |
|-----------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| MODNet (Photographic) | 25.0
24.7 | PyTorch
ONNX | 7c22235f0925deba15d4d63e53afcb654c47055bbcd98f56e393ab2584007ed8
d381d71c0e85f0edc28df99a6dd59544b0c33cc2bf234b1fc22aa417fec127be |
| MODNet (Webcam) | 25.0
24.7 | PyTorch
ONNX | 913b82b66558db39b6286c150f809017d7528c872b156eb14333c9c6cb52108b
52ace7b5c455f527542b496151996bed429b67ca8efc8bd793485a631363c688 |
Inference
shell
python -m demo.image_matting.colab.inference --ckpt-path pretrained/modnet-photographic.pt --image-path data/images/test.jpg --output-path result.jpg
Export to ONNX format
shell
pip install onnx onnxsim
shell
python -m onnx_model.export_onnx --ckpt-path pretrained/modnet-photographic.pt --output-path pretrained/modnet-photographic.onnx
python -m onnx_model.export_onnx --ckpt-path pretrained/modnet-webcam.pt --output-path pretrained/modnet-webcam.onnx
ONNX inference
shell
python -m onnx_model.inference_onnx --model-path pretrained/modnet-photographic.onnx --image-path data/images/test.jpg --output-path result.jpg
Owner
- Login: clibdev
- Kind: user
- Repositories: 1
- Profile: https://github.com/clibdev
GitHub Events
Total
- Push event: 1
Last Year
- Push event: 1
Dependencies
- Pillow *
- numpy *
- opencv-python *
- torch >=1.0.0
- torchvision *
- tqdm *
- Pillow *
- numpy *
- opencv-python *
- torch >=1.0.0
- torchvision *
- onnx ==1.8.1
- onnxruntime ==1.6.0
- opencv-python ==4.5.1.48
- torch ==1.7.1
- opencv-python >=4.8.0
- scipy >=1.11.0
- torch >=2.1.0
- torchvision >=0.16.0
- tqdm >=4.66.0