Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Default Embedder #58

Open
Hemilibeatriz opened this issue Sep 26, 2024 · 1 comment
Open

Change Default Embedder #58

Hemilibeatriz opened this issue Sep 26, 2024 · 1 comment

Comments

@Hemilibeatriz
Copy link

Hi! Thanks for this great repo!

Can you or anyone explain me how can i change the default embedder model in this code:

from deep_sort_realtime.deepsort_tracker import DeepSort
tracker = DeepSort(max_age=5, embedder='torchreid')
bbs = object_detector.detect(frame) 
tracks = tracker.update_tracks(bbs, frame=frame) # bbs expected to be a list of detections, each in tuples of ( [left,top,w,h], confidence, detection_class )
for track in tracks:
    if not track.is_confirmed():
        continue
    track_id = track.track_id
    ltrb = track.to_ltrb()

I made

embedder_model_name = "osnet_ain_x1_0"

# Inicializar o DeepSort com ReID usando TorchReID
tracker = DeepSort(max_age=5, embedder=embedder_model_name)

But i got

Traceback (most recent call last):
  File "C:/Users/hemil/Desktop/v5ds380/reid.py", line 14, in <module>
    tracker = DeepSort(max_age=5, embedder=embedder_model_name)
  File "C:\Users\hemil\Desktop\v5ds380\venv\lib\site-packages\deep_sort_realtime\deepsort_tracker.py", line 102, in __init__
    raise Exception(f"Embedder {embedder} is not a valid choice.")
Exception: Embedder osnet_ain_x1_0 is not a valid choice.

And i have this model installed

@Woodthorne
Copy link

The embedder argument for DeepSort is supposed to be a string chosen from 'mobilenet', 'torchreid', 'clip_RN50', 'clip_RN101', 'clip_RN50x4', 'clip_RN50x16', 'clip_ViT-B/32' and 'clip_ViT-B/16'. If you have your own embedder you wish to use you'll have to construct using DeepSort(..., embedder = None, ...) and then provide your own embeds to tracker.update_tracks().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants