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
296 stars 143 forks source link

Import DLC data button missing #376

Open KaiserArndt2 opened 3 months ago

KaiserArndt2 commented 3 months ago

Describe the bug When opening SimBA I am missing a 'Tracking' button that is supposed to allow for importing of DLC model data. The documentation on the Tutorial_DLC page shows buttons in the GUI to accomplish this. Have these button been patched out? If so is there what is the work around to import DLC data?

Expected behavior Ability to import DLC data.

Screenshots This is what my GUI looks like. image

This is what the GitHub documentation looks like. image

Desktop (please complete the following information): OS: Windows 11 Python Version 3.6.0 Are you using anaconda? Yes

sronilsson commented 3 months ago

Hi @KaiserArndt2!

Yes - I'm pasting the answer I gave to someone over on Gitter asking a similar question below.

When we first wrote SimBA, DeepLabCut and other pose-estimation tools didn’t have graphical interfaces, it was all command line. So we wrote a graphical interface for DeepLabCut, and included it the drop-down that you are looking for. Later, DeepLabCut wrote their own graphical interface (that was much better than ours). Because of this, and that I spend so much time help troubleshoot DeepLabCut for people, we decided to remove the drop-down, and direct people to use the DeepLabCut graphical interface and the DeepLabCut support forums instead

What I recommend is (i) installing DLC separately and follow their tutorials for creating tracking pose-estimation models and create data and (ii) import that data into SimBA.

PS. If you already have done this, ypou can create a project and import this data into your simba project using the menus in the screengrab below:

image

KaiserArndt2 commented 3 months ago

Hi @sronilsson,

Thank you for the information. I have done this for a test project. As I was going through the steps for that project I eventually hit an error that said the number of body parts in the SimBA config didn't match the DLC .CSV file. In the github documentation it says I shouldn't need to make a new pose configuration. Do I need to make a pose configuration now for the current pipeline for importing DLC?

I would attach photos but I attempted this last week. If it would be helpful I can recreate the issues.

Thanks for the help!

sronilsson commented 3 months ago

When you create a project in SimBA, you used one of the built in body-part configurations, lets say you picked this one:

image

SimBA stores this selection you make inside your project in the /project_folder/logs/measures/pose_configs/bp_names/project_bp_names.csv file.

Then at data import, SimBA opens each one of your CSV files from DLC and checks that they have 4 * 3 columns (x, y and p values for each of the four body-parts). If that is not true, then you can see this issue.

To see why it happened, can you share with me (i) a CSV from DLC you are truing to import, and (ii) /project_folder/logs/measures/pose_configs/bp_names/project_bp_names.csv of your SimBA project?

KaiserArndt2 commented 3 months ago

Here is the project_bp_names and a DLC CSV. project_bp_names.csv F1_training.csv

sronilsson commented 3 months ago

Thanks @KaiserArndt2 ! Yes - in your F1_training.csv - I see that you are tracking 15 body-parts on what looks like a single animal.

The SimBA project though, says that it is made for 4 body-parts.

That's where the error is coming from. You could edit the project_bp_names to list 15 body-parts instead of 4.

Alternatively, in the SimBA user-interface, create a pose-configuration for 15 body-parts and use that as documented HERE.

KaiserArndt2 commented 2 months ago

Hi @sronilsson,

Thank you for your help thus far, I am running into problems now loading files for outlier correction. I set the values of location and movement correction to 1.5 and .8 respectively and saved the input on that screen. When I click 'Run outlier correction' I get this output. image

Also here is an example video.csv and video_info.csv that simba is referencing. F3_training.csv video_info.csv

I am not sure what needs to be changed as the body parts file now reads correctly.

Thank you for any help!

sronilsson commented 2 months ago

Hi @KaiserArndt2! When you run outlier correction, SimBA will process all of the data files inside the project_folder/csv/input_csv directory. It is running along fine until SimBA finds a file called video_info.csv in this folder:

image

This file is probably not probably containing pose-estimation data in similar format from the other files.

If you delete / move the project_folder/csv/input_csv/video_info.csv, how does it run?

Simon