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

The Python virtual environment is correct but I get the following error when I run "bash ./execute_pipeline.sh ./0_input ./output" #3

Open
ZhongyuMa opened this issue Jan 15, 2020 · 5 comments

Comments

@ZhongyuMa
Copy link

egin Stage 1 : Shot Segmentation
Processing: ./0_input/image00002.jpg
Traceback (most recent call last):
File "shot_segmentation.py", line 93, in
do_shot_segmentation(f, filePath, input_folder, output_folder);
File "shot_segmentation.py", line 56, in do_shot_segmentation
output = pyannote_shot(filePath)
File "shot_segmentation.py", line 38, in pyannote_shot
for x in shots:
File "/home/yu/anaconda3/envs/face/lib/python3.6/site-packages/pyannote/video/structure/shot.py", line 120, in iter
t, y = zip(*self.iter_dfd())
ValueError: not enough values to unpack (expected 2, got 0)

@ZhongyuMa
Copy link
Author

The following slave error occurred when I used video as input,

Processing: ./0_input/multi_face.avi
Traceback (most recent call last):
File "shot_segmentation.py", line 93, in
do_shot_segmentation(f, filePath, input_folder, output_folder)
File "shot_segmentation.py", line 56, in do_shot_segmentation
output = pyannote_shot(filePath)
File "shot_segmentation.py", line 38, in pyannote_shot
for x in shots:
File "/home/yu/anaconda3/envs/face/lib/python3.6/site-packages/pyannote/video/structure/shot.py", line 120, in iter
t, y = zip(*self.iter_dfd())
File "/home/yu/anaconda3/envs/face/lib/python3.6/site-packages/pyannote/video/structure/shot.py", line 113, in iter_dfd
yield t, self.dfd(previous, current, flow=None)
File "/home/yu/anaconda3/envs/face/lib/python3.6/site-packages/pyannote/video/structure/shot.py", line 92, in dfd
dy, dx = flow[y, x]
TypeError: 'NoneType' object is not subscriptable
Checking paths for all stages.

@DevendraPratapYadav
Copy link
Owner

This seems to be an error during shot segmentation in pyannote library's pyannote_shot function. Can you try it with a different video? Preferably a mp4 file. The error you see may have occured due to a bad/unreadable video frame.

@ZhongyuMa
Copy link
Author

ZhongyuMa commented Jan 20, 2020 via email

@akshat1136
Copy link

I got the same error while trying the code and found the way around.
In /home/yu/anaconda3/envs/face/lib/python3.6/site-packages/pyannote/video/structure/shot.py file, line 77to 84, you will see that flow will be assigned only if cv2.version.split('.')[0] is either 2 or 3. But in latest pyannote-video github repo it has been updated for OpenCV version greater than 3 as well (link: https://github.com/pyannote/pyannote-video/blob/develop/pyannote/video/structure/shot.py).

So to run it just change the elif condition from OPENCV == 3 to OPENCV >= 3

@DevendraPratapYadav
Copy link
Owner

@ZhongyuMa Did the above help resolve the issue for you?

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