Instructions to use litert-community/SAM2.1-Hiera-Tiny-Image-Encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/SAM2.1-Hiera-Tiny-Image-Encoder 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
- sam2
How to use litert-community/SAM2.1-Hiera-Tiny-Image-Encoder with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained("litert-community/SAM2.1-Hiera-Tiny-Image-Encoder") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained("litert-community/SAM2.1-Hiera-Tiny-Image-Encoder") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>) # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
Commit History
9 days ago
-
README: link the browser demo (static Space litert-community/sam2-1-tiny-click-to-segment, LiteRT.js)
Verified signatured701df1
-
Card: base_model_relation: quantized (list under the base model's Quantizations)
Verified signaturee46fe44
-
Add the measured Pixel 8a CompiledModel rows the card had been missing
Verified signatureThe Device row carried Galaxy S26 figures only, because the Pixel 8a figure it used to carry (~7 ms/image) had no primary log and no measurement of either component on either device matches it. Measured on the phone: GPU 710.4 ms for the base file and 576.7 ms for the decoder-ready variant, both fully delegated (862/862 and 867/867 LITERT_CL), with a same-phone CPU control of 10545 ms for the variant -- 18x. No CPU row for the base file: four attempts each left the thermal window, and N=50 at ~11 s a call is ten minutes of unbroken CPU load. The absence is reported as the result rather than filled with a hot number. LiteRT CompiledModel 2.2.0, one accelerator per process, 5 warm-up then N=50 timed, median, every published row at thermal NONE throughout. Primary log: litertlm-convert/community_accel_work/s6_p8a/results.jsonl.ba15943 -
Add measured Galaxy S26 NPU/GPU section
Verified signatureNumbers from the S26 classic sweep. Primary logs: litertlm-convert/community_accel_work/s2_npu_sweep/results.jsonl (on-device JIT) and portal_work/bench_all.txt + bench_redo.txt (the 2026-08-23 AOT sweep); every row states which of the two produced it. Rows carry device, SoC, runtime, N and thermal state, and join to this repo by exact .tflite file name. Rows taken outside the sweep's thermal window are not reported.c007b06
-
Card: add a measured Performance table (Pixel 8a, benchmark_model GPU+CPU), naming the runtime for each row
Verified signature87d61a1
-
Embed hero image
Verified signaturec853ee0 -
Add hero image
Verified signaturebd298ec -
Add minimal usage snippets (Kotlin + Python)
Verified signature0fbcd90
-
Document the decoder-ready (v2) encoder variant
Verified signaturee71331b -
Add decoder-ready (v2) encoder for the interactive segmentation sample
Verified signature6bec073
-
Upload sam2_tiny_image_encoder_fp16.tflite with huggingface_hub
Verified signatureab3015f -
Upload README.md with huggingface_hub
Verified signature4a03748 -
initial commit
Verified signature4b04a85