Image Segmentation
Transformers
PyTorch
modnet
feature-extraction
image-matting
background-removal
computer-vision
custom-architecture
custom_code
Instructions to use boopathiraj/MODNet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use boopathiraj/MODNet with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="boopathiraj/MODNet", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("boopathiraj/MODNet", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files
modnet.py
CHANGED
|
@@ -3,7 +3,16 @@ import torch.nn as nn
|
|
| 3 |
import torch.nn.functional as F
|
| 4 |
import os
|
| 5 |
from .wrapper import *
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
#------------------------------------------------------------------------------
|
| 9 |
# MODNet Basic Modules
|
|
|
|
| 3 |
import torch.nn.functional as F
|
| 4 |
import os
|
| 5 |
from .wrapper import *
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
#------------------------------------------------------------------------------
|
| 9 |
+
# Replaceable Backbones
|
| 10 |
+
#------------------------------------------------------------------------------
|
| 11 |
+
|
| 12 |
+
SUPPORTED_BACKBONES = {
|
| 13 |
+
'mobilenetv2': MobileNetV2Backbone,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
|
| 17 |
#------------------------------------------------------------------------------
|
| 18 |
# MODNet Basic Modules
|