AdamSpannbauer / python_video_stab

A Python package to stabilize videos using OpenCV
https://adamspannbauer.github.io/python_video_stab/html/index.html
MIT License
682 stars 118 forks source link

No input file found #109

Closed notknowchild closed 4 years ago

notknowchild commented 4 years ago

Describe the bug FileNotFoundError(f'{input_path} does not exist')

Provide version info Python 3.5.6 cv2.version '4.2.0' vidstab version 1.7.3 OS:Windows10

I think this project is very interesting, but I don’t know how to run it. I just entered a line in the jupyter notebook: from vidstab import Vidstab, I got this error, I don’t know where this input_path should be put.

AdamSpannbauer commented 4 years ago

To confirm, you're saying the only line of code you ran was from vidstab import VidStab and you received the above error?

notknowchild commented 4 years ago

image Yes

AdamSpannbauer commented 4 years ago

The class name is VidStab rather than Vidstab (i apologize for the typo in my previous message if that led to this, I corrected it). However, I'm not sure that correcting the import statement (to from vidstab import VidStab) will fix the issue. I'm surprised that you didn't receive an ImportError instead of the one you're showing (i.e. when I run your line of code: ImportError: cannot import name 'Vidstab' from 'vidstab'). So there is something else going on that I'm not sure how to diagnose.

You might try reinstalling, restarting kernel, all the other go-to "turn it off and back on" techniques.

I am not an anaconda user. If your issue persists, I can try installing anaconda and seeing if I'm able to recreate your error that way.

notknowchild commented 4 years ago

I used: from vidstab import VidStab and still showed the above error. I reinstalled and used python3.5 and python2.7 to run, and displayed such information in VidStab.py. image What method did you use to run this code and What is the version of python?

AdamSpannbauer commented 4 years ago

Oh I just realized the issue. You’re receiving a syntax error because f strings were introduced in python 3.6 and your version of python is 3.5.3. Try using >=3.6

I’ll update the package to either avoid f strings or to be more explicit about its version requirements

notknowchild commented 4 years ago

Thank you, thank you very much. I ran this code using python3.7 and this error disappeared.

AdamSpannbauer commented 4 years ago

The short-term solution was to put a minimum python version in setup.py. Potentially revisit and consider older versions (but unlikely).