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

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

Open
GirishVaisyaraj opened this issue Sep 13, 2021 · 6 comments

Comments

@GirishVaisyaraj
Copy link

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

@Jacobsolawetz
Copy link

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
Copy link
Author

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
Copy link

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
Copy link

(Leaving open until resolved & merged)

@GirishVaisyaraj
Copy link
Author

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
Copy link
Author

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

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

3 participants