MASA-R50 (Hugging Face transformers port)

Port of MASA: Matching Anything by Segmenting Anything (CVPR 2024, arXiv:2406.04221), the masa_r50 "plug-and-play" checkpoint that embeds given boxes (no detector inside), converted from dereksiyuanli/masa. Original code: https://github.com/siyuanliii/masa (Apache-2.0).

The model code is in an open work-in-progress branch of transformers (issue #32164):

pip install git+https://github.com/omkar-334/transformers@add-masa
from transformers import MasaForObjectTracking, MasaImageProcessor, MasaTracker

processor = MasaImageProcessor()
model = MasaForObjectTracking.from_pretrained("omkar334/masa-r50").eval()
tracker = MasaTracker()  # same settings as the official tracker config
# per frame: boxes (N, 4) in the *processed* image coordinates, scores (N,) from any detector
pixel_values = processor(images=frame_rgb, return_tensors="pt")["pixel_values"]
embeddings = model(pixel_values, boxes=[boxes]).embeddings[0]
tracks = tracker.update(boxes, scores, embeddings, frame_id=0)  # dict: track_ids, boxes, scores

Parity with the official mmcv 2.1.0 / mmdet 3.3.0 model: embeddings within 4e-6, cosine >= 0.9999998. Demo notebook (original vs. port, identical tracks on 150/150 frames): see the masa-demo branch of the repo above.

Downloads last month
27
Safetensors
Model size
48.3M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for omkar334/masa-r50

Finetuned
(1)
this model

Paper for omkar334/masa-r50