simonarvin/eyeloop

Error running run_eyeloop.py

kinow opened this issue · 8 comments

kinow commented

New directory structure looks great!

Just tried running it after syncing, and re-installing dependencies with pip install -r requirements.txt, but got the following error:

Outputting data to /home/kinow/Development/python/workspace/eyeloop/data/trial_20200714-180721
Initiating tracking via cv
Traceback (most recent call last):
  File "eyeloop/run_eyeloop.py", line 53, in <module>
    EyeLoop()
  File "eyeloop/run_eyeloop.py", line 49, in __init__
    config.importer.route()
  File "/home/kinow/Development/python/workspace/eyeloop/eyeloop/importers/cv.py", line 54, in route
    self.first_frame()
  File "/home/kinow/Development/python/workspace/eyeloop/eyeloop/importers/cv.py", line 49, in first_frame
    raise ValueError(f"Video path at {self.vid_path} is not a file or directory!")
ValueError: Video path at /home/kinow/Development/python/workspace/eyeloop/0 is not a file or directory!
kinow commented

Tried the same command from the README:

python eyeloop/run_eyeloop.py --importer cv/vimba
...
Initiating tracking via cv/vimba
Invalid importer selected.
 invalid syntax (<string>, line 1)
Traceback (most recent call last):
  File "eyeloop/run_eyeloop.py", line 53, in <module>
    EyeLoop()
  File "eyeloop/run_eyeloop.py", line 48, in __init__
    config.importer = Importer()
NameError: name 'Importer' is not defined

Hi Bruno

You have to insert a video sequence or plug-in a webcam. Video files are available at repo eyeloop_playground. Then you run command
python EyeLoop/run_eyeloop.py -v *path to file*

kinow commented

Hi Simon,

Got it. Found it in the code too. What command should I do for an online test? Yesterday I was able to run python eyeloop.py as in the docs, and it magically displayed my webcam stream in the GUI. I was trying to re-run that command to validate #10

Thanks!

It might be worth writing some basic pytest integration tests to test some of the major branches of the code, not sure how you would do a stream from a webcam but the basic one you're using for the travis build check would be a good candidate to start with. We could then expand them as we go, building a nice set of tests to run before we make any pull requests. Happy to do this, just a bit snowed under with uni and work at the moment, but will get a chance on the weekend.

kinow commented

I thought about that too @cfculhane , but wasn't sure if there were already some plans or tests somewhere else. That would be really helpful in case another major change is required; and also helpful for external contributors who are not entirely sure they know what they are doing with their code changes (me, for example 😄 )

Maybe we can mock the part of the camera. Or maybe there's some driver of software that can be used to simulate a camera or video stream source.

Hi Simon,

Got it. Found it in the code too. What command should I do for an online test? Yesterday I was able to run python eyeloop.py as in the docs, and it magically displayed my webcam stream in the GUI. I was trying to re-run that command to validate #10

Thanks!

Hi @kinow

Hmm, that's odd. I just tested python run_eyeloop.py on Windows 10 and MacOS, both successfully grabbing video frames live from my webcamera.

OpenCV initialises webcameras using an int index (eg cv2.VideoCapture(0)). When running command python run_eyeloop.py, the video path is set to "0" by default. I suspect that a type mismatch, ie int(0) != str("0"), causes this error on your build. I reinforced the str type in commit ffc3bbe - let me know how it goes!

Best,
Simon

It might be worth writing some basic pytest integration tests to test some of the major branches of the code, not sure how you would do a stream from a webcam but the basic one you're using for the travis build check would be a good candidate to start with. We could then expand them as we go, building a nice set of tests to run before we make any pull requests. Happy to do this, just a bit snowed under with uni and work at the moment, but will get a chance on the weekend.

Great idea!

kinow commented

I am on a different laptop today. Cloned a fresh copy of eyeloop, create a virtual environment, and ran pip install -e .. Worked like a charm! This is a Windows 10 pro box, with Anaconda Python 3.7 (previous box was a Ubuntu LTS). Closing 👏 thanks!