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

GUI #2

Open
kari223 opened this issue Jul 7, 2022 · 6 comments
Open

GUI #2

kari223 opened this issue Jul 7, 2022 · 6 comments

Comments

@kari223
Copy link

kari223 commented Jul 7, 2022

Hello,

I am a biologist with little python experience. I have managed to install the FreeClimber files, but I'm not sure how to activate the GUI. have made an environment using conda and attempted to follow the tutorial. However, I am confused by this from the tutorial:

"A required .cfg is needed to run the command line tool. This file is generated by the GUI, or can be modified from the provided example.cfg file. The program will find all specified video files of a common type (file_suffix) that are nested within the specified parent folder (project_path), rather than where the configuration file is held." What does this mean and what do I do? I just want to start the GUI so I can input my video and parameters. Thank you so much for your help,

@adamspierer
Copy link
Owner

Hi there,

The error says you are running the program in its command line form (called from the command line) when you want to run the program in its GUI form (called from the command line). Assuming everything was set up following the tutorial and assuming you are in the right directory, step 1A gives the command to run the GUI from the command line:

pythonw ./scripts/FreeClimber_gui.py --video_file ./example/w1118_m_2_1.h264

@kari223
Copy link
Author

kari223 commented Jul 23, 2022

Hi there,

Thank you for your help with this matter. I have managed to follow the tutorial, and when I attempt to run the program the GUI starts, asks me to pick a video file and then suddenly stops. I have attempted to run it both from the command line and the cloned GitHub flie on my laptop. Before the program closes, the error message reads:

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes n position 2-3: truncated \UXXXXXXXX escape
OnInit returned false, exiting...

Kind regards,
Karina.

@BerMoa
Copy link

BerMoa commented Aug 1, 2022

Hello,

did you solve the problem? I Jave the same problem.

Loading: /Users/XXXXXXX/FreeClimber/example/w1118_m_2_1.mp4

!! Could not read /Users/CCCCCC/FreeClimber/example/w1118_m_2_1.mp4 into FreeClimber. Likely due to unacceptable video file or FFmpeg not installed
!! Could not read in video file metadata
Traceback (most recent call last):
File "/Users/XXXXXXX/FreeClimber/scripts/detector.py", line 276, in video_to_array
out,err = (ffmpeg
AttributeError: module 'ffmpeg' has no attribute 'input'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./scripts/FreeClimber_gui.py", line 40, in OnInit
frame = create(None, file_name)
File "./scripts/FreeClimber_gui.py", line 782, in create
return main_gui(parent, file_path)
File "./scripts/FreeClimber_gui.py", line 125, in init
self.load_video()
File "./scripts/FreeClimber_gui.py", line 192, in load_video
variables = vars)
File "/Users/iceman/FreeClimber/scripts/detector.py", line 76, in init
self.image_stack = self.video_to_array(video_file,loglevel='panic')
File "/Users/XXXXXXX/FreeClimber/scripts/detector.py", line 283, in video_to_array
print('!! Could not read in video file to an array. Error message (if any):', err)
UnboundLocalError: local variable 'err' referenced before assignment
OnInit returned false, exiting...

@adamspierer
Copy link
Owner

@kari223 - Your error might be caused by how the file path is compiled? Try swapping the "/" in the file path with "" since Macs and Windows have different path formatting. I'm unsure if this will solve it completely, but it looked similar to a problem here and the program should work on Windows. Keep me posted either way and we can figure it out!

@adamspierer
Copy link
Owner

@BerMoa - Your error is likely because FFmpeg is not (properly) installed on your computer. If the instructions in the tutorial don't work, then install FFmpeg manually and re-run through the instructions in the tutorial.

I found success installing it through Homebrew though it is also available through the FFmpeg website and should work that way as well.

@kari223
Copy link
Author

kari223 commented Aug 2, 2022

@adamspierer Hello, Thank you for your help. I am now getting a different issue when I run this:
"C:\Users\karin\Desktop\Git Cloning\FreeClimber\scripts\FreeClimber_main.py" --config_file "C:\Users\karin\Desktop\Git Cloning\example_w1118_m_2_1.avi"

So the program begins and the file path is recognized (I think), but then this happens:

########################################################################

FreeClimber v.0.4.0

Please cite: https://doi.org/10.1242/jeb.229377######################

Beginning program @ 2022-08-02 20:23:40

########################################################################
Traceback (most recent call last):
File "C:\Users\karin\Desktop\Git Cloning\FreeClimber\scripts\FreeClimber_main.py", line 489, in
main()
File "C:\Users\karin\Desktop\Git Cloning\FreeClimber\scripts\FreeClimber_main.py", line 454, in main
fc = FreeClimber(config_file = config_file)
File "C:\Users\karin\Desktop\Git Cloning\FreeClimber\scripts\FreeClimber_main.py", line 36, in init
self.load_parameters()
File "C:\Users\karin\Desktop\Git Cloning\FreeClimber\scripts\FreeClimber_main.py", line 52, in load_parameters
variables = f.readlines()#.split('\n')
File "C:\Users\karin\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 5682: character maps to

I'm not really sure what this means but do you have any suggestions for fixing it? Thank 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