Closed mirceaciu closed 6 years ago
Hi there, A GPU is not a must as long as you can run tensorflow framework. This project read a video file and output a video file, please refer to the code for detail and you can change by your will to support the camera application etc.
With regards!
the output video is blank
@mirceaciu do you solve this problem? I meet this too
@mirceaciu, @z362194037: I can't explain why, but in my case It worked well only when input video is in mp4 format and output video in avi format. Hope it can help you.
@johanna-codes which opencv version do you use?
I did use .mp4 as input and .avi as output.Compiled OpenCv version is 3.2.0
@z362194037 I'm using OpenCV version 3.1.0
@mirceaciu change the dimension to your .mp4 file in tensorflow-face-detection.py line46 get work
Setting the output video dimensions same as the camera's input solves the output write problem.
Would be nice to make it work with cv2.imwrite
, but i guess this runs in some kind of multi thread so this might not be possible.
@mirceaciu @yeephycho If you are using opencv (built with fmpeg) to write video output, you need to pay attention to the following:
The file name extension (e.g. avi, mp4) of the output must be supported by ffmpeg and the system. AVI seems to work out of the box on Ubuntu systems.
if out is None: [h, w] = image.shape[:2] fps=8 fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('./media/test_out.avi', fourcc, fps, (w, h))
The output video for me is blank.
If I do
cv2.imshow("face", image)
it won't show any windows. If i docv2.imwrite("frames/%s.jpg" % time.time(), image)
i can see that frames are being processed, inference time cost is ~0.42.Tested on Ubuntu 16 machine with no GPU. Is GPU a requirement?