sgoldenlab / simba

SimBA (Simple Behavioral Analysis), a pipeline and GUI for developing supervised behavioral classifiers
https://simba-uw-tf-dev.readthedocs.io/
GNU General Public License v3.0
289 stars 141 forks source link

Impossible to analyse ROI with 1 FPS video #249

Closed DorianBattivelli closed 1 year ago

DorianBattivelli commented 1 year ago

Hello,

I'm trying to analyze ROI from csv files obtained from DLC, for single animal, on Windows 10. My videos are 1 fps, and after I drew the ROIs, prompt returns: " Videos in your SimBA project have an FPS of 1 or less. Please use videos with more than one frame per second, or correct the inaccurate fps inside the project_folder/logs/videos_info.csv file "

I was thinking to convert all my videos to >1 fps, but maybe there is a way to analyze 1 fps videos direclty?

Thank you, Best,

sronilsson commented 1 year ago

Hi @DorianBattivelli - do you have a traceback copy paste or screengrab of the OS terminal of the error and I will have a look around where it is thrown? I want to see why I put the limit at 1 FPS: you should be able to run it at 1 FPS although you may miss some events and velocity / movement can be off a bit at that resolution.

DorianBattivelli commented 1 year ago

Thanks for the quick answer, here what returns the terminal after I converted one video in 2 fps. Apparently it does like this frequency either :) Simba_Error_1fps

sronilsson commented 1 year ago

Thanks @DorianBattivelli - for troubleshooting, would you mind using latest SimBA? If you don't want to upgrade, could you test in a new conda environment with the latest SimBA and check how the error looks like?

DorianBattivelli commented 1 year ago

Here we go! Simba_Error_1fps

sronilsson commented 1 year ago

Ah thank you! Just to confirm, SimBA grabs the file from the project_folder/csv/outlier_corrected_movement_location folder to perform the ROI analysis, do you have files representing your videos in this directory?

DorianBattivelli commented 1 year ago

No I don't... Should I run outlier correction again? I try this and keep you posted

sronilsson commented 1 year ago

Yes, or click to skip - make sure the videos that you want analyzed are represented in that directory.

DorianBattivelli commented 1 year ago

Everything works fine, it looks we did not run the outlier step properly,

Thank you!

sronilsson commented 1 year ago

Cheers @DorianBattivelli ! Let me know if any other errors pop up!

DorianBattivelli commented 1 year ago

I am facing another problem now. I previously selected ROIs with the old version of SimBA (I unfortunately don't know which version), with the new ROI interface. Now after updating and analyzing the ROI data, it looks like the data of the polyglon shaped ROIs are not picked up. Is there a solution for this or do I have to redraw all the polyglon ROIs?

sronilsson commented 1 year ago

Ah got it, you should not have to re-draw, maybe there is a key name mis-match between versions I haven't taken care off.

Can you drop your project_folder/logs/measures/ROI_definitions.h5 file here and I can see if I can replicate it and fix?

DorianBattivelli commented 1 year ago

It looks the format is not accepted here, maybe by email?

sronilsson commented 1 year ago

Does it work if you zip the file and drop it here?

DorianBattivelli commented 1 year ago

ezyzip.zip

sronilsson commented 1 year ago

@DorianBattivelli - unzip this one try replacing your project_folder/logs/measures/ROI_definitions.h5 with this it and let me know if that fixes it:

ROI_definitions.h5.zip

DorianBattivelli commented 1 year ago

Amazing, everything is now working fine! Thank you

sronilsson commented 1 year ago

Cheers! I will insert a fix in simba next week to make sure this can't happen again.