roboflow / zero-shot-object-tracking

Object tracking implemented with the Roboflow Inference API, DeepSort, and OpenAI CLIP.
https://blog.roboflow.com/zero-shot-object-tracking/
GNU General Public License v3.0
362 stars 64 forks source link

I can not inference with my model ! #33

Open AmirAzz opened 1 year ago

AmirAzz commented 1 year ago

Thanks for this video , I tried to use this code :

!python clip_object_tracker.py --source /content/zero-shot-object-tracking/data/video/Turkey.mp4 --url https://detect.roboflow.com/video-track/2 --api_key *** --info

but this issue appears:

video 1/1 (23/1351) /content/zero-shot-object-tracking/data/video/Turkey.mp4: [Detections] [Tracks] 2 Traceback (most recent call last): File "clip_object_tracker.py", line 370, in detect() File "clip_object_tracker.py", line 269, in detect update_tracks(tracker, frame_count, save_txt, txt_path, save_img, view_img, im0, gn) File "clip_object_tracker.py", line 46, in update_tracks class_name = names[int(class_num)] if opt.detection_engine == "yolov5" or "yolov7" else class_num ValueError: invalid literal for int() with base 10: 'damage

kjohnabbott commented 1 year ago

I am also having the same issue with a Roboflow model I'm using. Here is my traceback that is similar:

video 1/1 (3/1122) /content/Copy of 20210812_SharkOutsideLineUP.mp4: [Detections] [Tracks] 12 Traceback (most recent call last): File "/content/zero-shot-object-tracking/clip_object_tracker.py", line 370, in detect() File "/content/zero-shot-object-tracking/clip_object_tracker.py", line 269, in detect update_tracks(tracker, frame_count, save_txt, txt_path, save_img, view_img, im0, gn) File "/content/zero-shot-object-tracking/clip_object_tracker.py", line 46, in update_tracks class_name = names[int(class_num)] if opt.detection_engine == "yolov5" or "yolov7" else class_num ValueError: invalid literal for int() with base 10: 'shark'

it appears I'm getting this error only at the 3rd frame of the video, though.

roytravel commented 1 year ago

It will work well if you change the code as below @AmirAzz , @kjohnabbott

if opt.detection_engine == "yolov5" or opt.detection_engine == "yolov7":         class_name = names[int(class_num)] else:         class_name = class_num