Instructions to use litert-community/MediaPipe-ImageSegmenter-Selfie-Landscape with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/MediaPipe-ImageSegmenter-Selfie-Landscape 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
MediaPipe Selfie Segmenter (Landscape 144×256)
Landscape-aspect portrait segmentation model (selfie_segmenter_landscape.tflite, 250 KB, FP16 weights, 144 x 256 H×W input) tailored for 16:9 video calls and desktop webcams using the MediaPipe Image Segmenter (ImageSegmenter) task.
Documentation: MediaPipe Image Segmenter Docs
Samples: Android · iOS · Python Colab · Web · Flutter
Try live: Web Demo
Identical MobileNetV3-like encoder-decoder family as selfie_segmenter.tflite, reshaped for landscape [1, 144, 256, 3] RGB frames to reduce compute on wide video-conferencing streams.
Files
| File | Precision | Size | SHA-256 |
|---|---|---|---|
selfie_segmenter_landscape.tflite |
float16 |
250.2 KB (250,177 B) | 490e9ea734313e0de10fa0cd9e3c6133e36ea4db2b7a49bde9ef019f72796b8e |
Companion Files in Repo Root
| File | Role | Size | SHA-256 |
|---|---|---|---|
Model Card MediaPipe Selfie Segmentation.pdf |
Upstream Google model card (PDF) | 2.29 MB (2,286,837 B) | ef2e8d350891ba71699ac1e079658e697fc8d48c0f9253922990e907ecdade60 |
Download
pip install -U huggingface_hub
hf download litert-community/MediaPipe-ImageSegmenter-Selfie-Landscape selfie_segmenter_landscape.tflite --local-dir .
Inputs, Outputs, and Model Specifications
selfie_segmenter_landscape.tflite
- Embedded
TFLITE_METADATA: nameImageSegmenter· version1· authorMediaPipe· packed associated files:labels.txt
| Direction | Tensor | Shape | Type | Notes |
|---|---|---|---|---|
| Input | input_1 |
[1, 144, 256, 3] |
float32 |
image — Input image to be processed. — Normalization: mean=[0.0], std=[255.0] |
| Output | segment_back |
[1, 144, 256, 1] |
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-Selfie-Landscape",
filename="selfie_segmenter_landscape.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=True,
)
with ImageSegmenter.create_from_options(options) as runner:
mp_image = mp.Image.create_from_file("input.jpg")
result = runner.segment(mp_image)
print("Confidence masks:", len(result.confidence_masks), "Category mask size:", result.category_mask.width)
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 |
|---|---|---|---|
| SelfieSegmenter (landscape) | Pixel 6 | 34.19 ms | 33.55 ms |
Intended Use, Limitations, and Fairness
Summarized from the bundled Model Card MediaPipe Selfie Segmentation.pdf (Google, May 6, 2021):
- Intended applications: Real-time portrait/background segmentation in landscape video conferencing and AR effects.
- Out-of-scope uses:
- Any form of surveillance or identity recognition is explicitly out of scope and not enabled by this technology.
- Human life-critical decisions, multiple people at very different scales, or people > 4 meters (14 ft) from the camera.
- Fairness evaluation (Landscape 144×256 model, 1,594 images vs. 98.74% human inter-annotator IoU):
- 17 UN geographic subregions: average IoU 95.99 ± 0.87% (range 94.71%–97.27%; max region deviation 1.28%).
- Fitzpatrick skin tones 1–6: average IoU 96.08% (range 95.40%–96.55%).
- Perceived gender: 95.77% Female / 96.37% Male.
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 |
|---|---|---|---|---|
selfie_segmenter_landscape.tflite |
selfie_segmenter_landscape.tflite |
1683436452396689 |
Sun, 07 May 2023 05:14:12 GMT | /1/ |
License and Citation
- License:
apache-2.0— Stated as Apache License, Version 2.0 in the bundled upstream Google model-card PDF.
- Downloads last month
- 26