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
287 stars 140 forks source link

Outlier correction - error #104

Closed DorianBattivelli closed 3 years ago

DorianBattivelli commented 3 years ago

Hello,

I run a multi animal (2 mice) project analyzed with deeplabcut 2.1.10.2. I now intend to proceed to ROI analysis on Simba 1.3.5. The following issue appears when I try to run the Outlier correction:

SimbaBug

For the body parts of my 2 animals, I selected center and tail base, and followed your recommendations with 1.5 for location criterion and 1 for movement criterion.

Now, in the logs folder, I have only a "Outliers_movement_20210423183614" but no Outliers_location" file. Moreover, the Outliers_movement file is empty:

SimbaBug2

Could you please tell me how to fix this issue?

Thank you very much, Best, Dorian

DorianBattivelli commented 3 years ago

I tried also to use the "skip outlier correction". But once my ROIs are defined and drawn, if I try to analyze the ROI, here what I have:

Untitled

Do you have an idea of what is wrong in my project?

Thank you, Best, Dorian

DorianBattivelli commented 3 years ago

FYI: I see on my dlc csv file that some cells are blank, meaning that signal is lost for some frames. Here an example

Untitled

On SimBA I imported h5 files, but I think they also contain these "missing data"right? Could that produce the error?

sgoldenlab commented 3 years ago

Hello @DorianBattivelli, a few points:

1) I suggest running the latest dev version of SimBA, rather than the TF version. So in your environment, run:

pip uninstall simba-uw-tf, followed by pip install simba-uw-tf-dev

2). Yes, SimBA does not like missing data. When you export your H5's from DLC, make sure you are not filtering the data based on probabilities. Take it all. SimBA should fill in the blanks with zeros - but generally - do not filter/remove any of your DLC output.

3) What's happening based on this picture:

image

... suggests that SimBA never imported the files correctly. This suggests that SimBA is looking in your project_folder/csv/input_csv directory for files, and finds 0 files. Could you make sure that the files are there? Try with the simba-uw-dev version, let me know if using that version of SimBA does the trick.

DorianBattivelli commented 3 years ago

@sgoldenlab thank you very much for the help. I installed the dev version, and for now when I import the h5 files, the csv-input folder is still empty, is this normal?

Untitled

Just for confirmation, am I importing the good h5 file? Untitled2

DorianBattivelli commented 3 years ago

I also noticed this message: Cannot locate video CD1_1-ph2-1-1DLC_resnet_50_Arena-CD1-protocol2-ph2Apr12shuffle1_6000_bx.h5 in mp4 or avi format

I imported the standard mp4 video (and they are in the videos folder), did I import the wrong videos?

sgoldenlab commented 3 years ago

@DorianBattivelli - ah I see, I'm not sure how this happened, but I presume that your videos are called, for example CD1_1-ph2-1-1.mp4. SimBA looks for a video file name in your project that matches the H5 file name, in this case you get an error as either because (i) your h5's are named differently from your videos (e.g., CD1_1-ph2-1-1DLC_resnet_50_Arena-CD1-protocol2-ph2Apr12shuffle1_6000_bx.h5 vs CD1_1-ph2-1-1.mp4). Could you try remove the DLC appended string to the filenames (e.g., DLC_resnet_50_Arena-CD1-protocol2-ph2Apr12shuffle1_6000_bx) and see if it works? SimBA should do this automatically so not sure why it hasn't at this instance... (ii) or you have not imported any videos. You need to import the h5's after you have imported the videos to your SimBA project.

DorianBattivelli commented 3 years ago

I am still facing the issue..

Untitled

sgoldenlab commented 3 years ago

sorry, Ignore my last msg then, and rename your files back to what they were.

Can you send me a screenshot if your project_folder/videos directory?

DorianBattivelli commented 3 years ago

Here it is:

Untitled

sgoldenlab commented 3 years ago

Thanks looking into this, will insert a better error msg so I can see what is going on

sgoldenlab commented 3 years ago

I think I see what is happening, thanks for reporting this, seems like DLC has changed the appended string from DLC_resnet50 to DLC_resnet_50.... for whatever reason.

DorianBattivelli commented 3 years ago

Well done, it solved the problem, thank you very much!

sgoldenlab commented 3 years ago

Cheers, I will update SimBA to handle either form.