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
357 stars 62 forks source link

list attribute has no element shape for im0 in real time streaming #9

Open GirishVaisyaraj opened 2 years ago

GirishVaisyaraj commented 2 years ago

the code runs fine for offline videos but for webcam the above error arises

Jacobsolawetz commented 2 years ago

Hello @GirishVaisyaraj - we haven't built with webcam streaming in mind. Are you familiar with the YOLOv5 webcam detect and are expecting to use it similarly? Would you care to share a bit more in depth what you are developing?

GirishVaisyaraj commented 2 years ago

Issure resolved. There is an error in code. the get_clip_detections file is ok for offline videos but for real time streaming the ffeatures = self.model.encode_image(torch.stack(out)).cpu().numpy() has to be replaced by features = self.model.encode_image(torch.stack(out)).cpu().detach().numpy()

Jacobsolawetz commented 2 years ago

Awesome, thanks for looking into it @GirishVaisyaraj! @maxhs2014 we can take a look and see if we can add this to switch based on the input source

yeldarby commented 2 years ago

(Leaving open until resolved & merged)

GirishVaisyaraj commented 2 years ago

There is issue with images too.The detections and prediction happen but the original image is saved to runs without any labels or bboxes

GirishVaisyaraj commented 2 years ago

Addition: For real time streaming, change the dimension of im0 from (1,x,y,z0) to (x,y,z) where XYZ is the dimension of the image so basically do im0=np.array(im0[0]) after p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0) in the clip_object_tracker.py