Open GirishVaisyaraj opened 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?
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()
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
(Leaving open until resolved & merged)
There is issue with images too.The detections and prediction happen but the original image is saved to runs without any labels or bboxes
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
the code runs fine for offline videos but for webcam the above error arises