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

"TypeError: isinstance() arg 2 must be a type or tuple of types" error #119

Open
Rothax opened this issue Jan 29, 2021 · 2 comments
Open

Comments

@Rothax
Copy link

Rothax commented Jan 29, 2021

I am trying to run this code in a raspberry 4.b. But it gives this error
error

pi@raspberrypi:~/python_video_stab-master/vidstab $ python3 videocap.py
Traceback (most recent call last):
File "videocap.py", line 6, in
max_frames=1000
File "/home/pi/.local/lib/python3.7/site-packages/vidstab/VidStab.py", line 551, in stabilize
self.frame_queue.set_frame_source(cv2.VideoCapture(input_path))
File "/home/pi/.local/lib/python3.7/site-packages/vidstab/frame_queue.py", line 36, in set_frame_source
if isinstance(source, cv2.VideoCapture):
TypeError: isinstance() arg 2 must be a type or tuple of types

@yzn9961
Copy link

yzn9961 commented Jun 9, 2021

Hey,Rothax. I just solved this problem by changing the two isinstance()functions in /home/pi/.local/lib/python3.7/site-packages/vidstab/frame_queue.py from

isinstance(source, cv2.VideoCapture):

to

  isinstance(source, type(cv2.VideoCapture())):

Then it works. Hope that helps you.

@AdamSpannbauer
Copy link
Owner

Sorry for the lack of any development on this project. I didn't even see this issue was opened until @yzn9961's comment.

I'll implement the change shown above. Thanks for the solve.

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