Instructions to use zeromodels/deeplabv3_resnet101_coco_voc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/deeplabv3_resnet101_coco_voc with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use zeromodels/deeplabv3_resnet101_coco_voc with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/deeplabv3_resnet101_coco_voc") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of DeepLabV3.
Run DeepLabV3 with Keras 3: JAX, PyTorch, or TensorFlow
kerasformers/deeplabv3_resnet101_coco_voc
Paper: Rethinking Atrous Convolution for Semantic Image Segmentation (arXiv:1706.05587) · HF Papers
DeepLabV3 does semantic segmentation: every pixel gets a class, with no notion of separate object instances. Dilated (atrous) convolutions widen the receptive field without further downsampling, and Atrous Spatial Pyramid Pooling samples several dilation rates so one layer sees objects at multiple scales.
Pure-Keras 3 port for kerasformers, converted from the official upstream release. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a semantic segmentation checkpoint (DeepLabV3SemanticSegment, ResNet-101, VOC 21 classes) converted from torchvision.
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from kerasformers.models.deeplabv3 import DeepLabV3SemanticSegment, DeepLabV3ImageProcessor
model = DeepLabV3SemanticSegment.from_weights("kerasformers/deeplabv3_resnet101_coco_voc")
processor = DeepLabV3ImageProcessor.from_weights("kerasformers/deeplabv3_resnet101_coco_voc")
image = Image.open("your_image.jpg").convert("RGB")
output = model(processor(image)["pixel_values"], training=False)
result = processor.post_process_semantic_segmentation(
output, target_size=(image.height, image.width)
)
print(result["segmentation"].shape)
Load any DeepLabV3 variant the same way with from_weights("kerasformers/<variant>"):
| Variant | Hub | Backbone |
|---|---|---|
deeplabv3_resnet50_coco_voc |
kerasformers/deeplabv3_resnet50_coco_voc |
ResNet-50 |
deeplabv3_resnet101_coco_voc |
kerasformers/deeplabv3_resnet101_coco_voc |
ResNet-101 |
Tips
- Set
KERAS_BACKENDbefore importing Keras / kerasformers. - VOC vocabulary: 20 classes plus background.
- See DeepLabV3 docs and Loading Weights.
- Community / upstream weights: See the KerasFormers docs for upstream conversion notes.
Special Thanks
A huge thank you to the DeepLab authors and the torchvision maintainers for releasing these models.
License: BSD-3-Clause (torchvision).
- Downloads last month
- 42