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

Video Capture Not Opening error on Docker #2

Closed
d-bohn opened this issue May 9, 2019 · 3 comments
Closed

Video Capture Not Opening error on Docker #2

d-bohn opened this issue May 9, 2019 · 3 comments

Comments

@d-bohn
Copy link

d-bohn commented May 9, 2019

Hey,

Great package. Thank you for developing this!

I'm trying to get this package up and running in a docker image (Ubuntu 18.04), and everything seems to go smoothly until I try and run the video example. When I run it I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/fer/classes.py", line 176, in analyze
    assert self.cap.open(self.filepath), "Video capture not opening"
AssertionError: Video capture not opening

I'm assuming that this is because in docker you can't open Xwindow by default, so I turned the display=True to display=False but I still get the error. The image example works fine. Outside of docker, I can run the video example OK, and can even run:

raw_data = video.analyze(detector, display=False, output="pandas", annotate_frames=False, save_frames=False)

Without it opening an additional window. Any ideas on a work-around?

Thanks

PS - I noticed when I built my docker image that you are missing requests from requirements.txt, and some of the code seems to only be compatible with python >= 3.6, not 3.4. Just a heads up!

@JustinShenk
Copy link
Owner

JustinShenk commented May 10, 2019

Thanks for your feedback and suggestions! I updated requirements and fixed a bug in the pandas and csv conversions in 61afcaa. Please feel free to try the new fer==0.1.2.

Regarding the docker issue, can you provide the code where this issue occurs? I didn't have the same problem, but it may be due to the docker image. Please try it with something similar:

FROM jjanzic/docker-python3-opencv

COPY . /usr/local/src

WORKDIR /usr/local/src

RUN pip3 install fer

ENTRYPOINT ["bash"]

The opencv installed must have support for FFMPEG to handle video capture, and not all pip binaries are built with that.

@JustinShenk
Copy link
Owner

@d-bohn. I ran into the same issue on Travis CI, and fixed it by unpinning the opencv version and adding both opencv-python and opencv-contrib-python. Please try again with fer==0.1.3.

@JustinShenk
Copy link
Owner

Closing issue.

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

2 participants