hukkelas / deep_privacy2

DeepPrivacy2 - A Toolbox for Realistic Image Anonymization
Apache License 2.0
292 stars 33 forks source link

Cant open camera by index #6

Closed ammar-deep closed 1 year ago

ammar-deep commented 1 year ago

I have installed it with docker. It works fine on static images. However when I do webcam anonymization, I get "cant open camera by index".

I have tried built in camera and also usb camera both are giving same error.

I have also tried to change the index here https://github.com/hukkelas/deep_privacy2/blob/50ce66a75ec6e58db714ddfa91e8f2731d87d3b2/anonymize.py#L158 from 0-2 but the problem remains.

When i run a dummy open camera on a separate python file using opencv it works fine.

hukkelas commented 1 year ago

Did you test your dummy script inside of the docker container?

ammar-deep commented 1 year ago

No I didn't. Do I need to?

ammar-deep commented 1 year ago

I tried to run my dummy script inside the docker container and it gives the same above error. Well what can be the issue in this case?

hukkelas commented 1 year ago

This is an issue with docker then. Check this stackoverflow post about it, where the same issue is documented.