Instructions to use litert-community/MediaPipe-ImageSegmenter-DeepLab-V3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/MediaPipe-ImageSegmenter-DeepLab-V3 with LiteRT:
# 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
- Notebooks
- Google Colab
- Kaggle
Download README.md from litert-community/MediaPipe-ImageSegmenter-DeepLab-V3: direct link, hf CLI and curl.
- Browser
- Download file 7.36 kB
-
https://huggingface.co/litert-community/MediaPipe-ImageSegmenter-DeepLab-V3/resolve/main/README.md
- Command line
-
hf download hf://litert-community/MediaPipe-ImageSegmenter-DeepLab-V3/README.md
-
curl -L -o README.md https://huggingface.co/litert-community/MediaPipe-ImageSegmenter-DeepLab-V3/resolve/main/README.md
license: apache-2.0
library_name: litert
pipeline_tag: image-segmentation
tags:
- mediapipe
- litert
- tflite
- image-segmentation
- on-device
- android
- ios
- web
- python
- flutter
- deeplab-v3
- semantic-segmentation
- pascal-voc
- fp32
MediaPipe DeepLab-v3 (Image Segmenter)
General-purpose DeepLab-v3 semantic segmentation model (deeplab_v3.tflite, 2.8 MB, FP32, 257 x 257 input) segmenting 21 Pascal VOC classes (background, person, cat, dog, potted plant, vehicles, furniture) for the MediaPipe Image Segmenter (ImageSegmenter) task.
Documentation: MediaPipe Image Segmenter Docs
Samples: Android · iOS · Python Colab · Web · Flutter
Try live: Web Demo
Uses atrous spatial pyramid pooling (ASPP) over [1, 257, 257, 3] RGB input to produce [1, 257, 257, 21] per-pixel logits/probabilities. Embeds labelmap.txt / labels.txt in TFLITE_METADATA:
0: background, 1: aeroplane, 2: bicycle, 3: bird, 4: boat, 5: bottle, 6: bus, 7: car, 8: cat, 9: chair, 10: cow, 11: dining table, 12: dog, 13: horse, 14: motorbike, 15: person, 16: potted plant, 17: sheep, 18: sofa, 19: train, 20: tv.
Files
| File | Precision | Size | SHA-256 |
|---|---|---|---|
deeplab_v3.tflite |
float32 |
2.78 MB (2,780,176 B) | ff36e24d40547fe9e645e2f4e8745d1876d6e38b332d39a82f0bf0f5d1d561b3 |
Download
pip install -U huggingface_hub
hf download litert-community/MediaPipe-ImageSegmenter-DeepLab-V3 deeplab_v3.tflite --local-dir .
Inputs, Outputs, and Model Specifications
deeplab_v3.tflite
- Embedded
TFLITE_METADATA: nameImageSegmenter· version1· authorMediaPipe· packed associated files:labelmap.txt,labels.txt
| Direction | Tensor | Shape | Type | Notes |
|---|---|---|---|---|
| Input | sub_7 |
[1, 257, 257, 3] |
float32 |
image — Input image to be processed. — Normalization: mean=[127.5], std=[127.5] |
| Output | ResizeBilinear_3 |
[1, 257, 257, 21] |
float32 |
segmentation_masks — Masks over the target objects with high accuracy. — Labels: labels.txt |
Use with MediaPipe Tasks
Python Quickstart
pip install -U mediapipe huggingface_hub
import mediapipe as mp
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="litert-community/MediaPipe-ImageSegmenter-DeepLab-V3",
filename="deeplab_v3.tflite",
)
BaseOptions = mp.tasks.BaseOptions
ImageSegmenter = mp.tasks.vision.ImageSegmenter
ImageSegmenterOptions = mp.tasks.vision.ImageSegmenterOptions
VisionRunningMode = mp.tasks.vision.RunningMode
options = ImageSegmenterOptions(
base_options=BaseOptions(model_asset_path=model_path),
running_mode=VisionRunningMode.IMAGE,
output_category_mask=True,
output_confidence_masks=False,
)
with ImageSegmenter.create_from_options(options) as runner:
mp_image = mp.Image.create_from_file("input.jpg")
result = runner.segment(mp_image)
print("Category mask shape:", result.category_mask.numpy_view().shape)
Cross-Platform Guides & Samples
- Task overview & options: Image Segmenter documentation
- Platform setup guides: Python · Web / JavaScript · Android (Kotlin / Java) · iOS (Swift) · Flutter (Dart)
- Runnable sample apps: Web Demo · Web Source · Android · iOS · Python Notebook · Flutter
Latency Benchmarks
End-to-end MediaPipe Task pipeline average latency reported by the Image Segmenter documentation:
| Model Variant | Device | CPU Latency | GPU Latency |
|---|---|---|---|
| DeepLab-V3 | Pixel 6 | 123.93 ms | 103.30 ms |
Intended Use, Limitations, and Fairness
- Intended applications: General-purpose scene segmentation across the 20 foreground Pascal VOC object classes plus background (photo effects, foreground extraction, scene understanding).
- Limitations & considerations: Restricted to the 21 Pascal VOC categories at
257 x 257model resolution; fine boundaries or out-of-vocabulary objects are not separated. No standalone Google fairness PDF is published for DeepLab-v3 on the MediaPipe documentation page.
Provenance
Every model binary in this repository is byte-identical (unmodified FlatBuffer weights and embedded TFLITE_METADATA bytes) to the official artifact served by Google from storage.googleapis.com/mediapipe-models.
| Repo File | Upstream URL | GCS Generation | Upstream Last-Modified |
Pinned Bucket Version |
|---|---|---|---|---|
deeplab_v3.tflite |
deeplab_v3.tflite |
1682480021097695 |
Wed, 26 Apr 2023 03:33:41 GMT | /1/ |
License and Citation
- License:
apache-2.0— Distributed under Apache License, Version 2.0 alongside the MediaPipe release artifacts.