See our collection for all versions of DeepLabV3.

Run DeepLabV3 with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

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_BACKEND before 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
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including zeromodels/deeplabv3_resnet101_coco_voc

Paper for zeromodels/deeplabv3_resnet101_coco_voc