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
279 stars 138 forks source link

Help with behavior labeling. #204

Open Gfernandezv opened 1 year ago

Gfernandezv commented 1 year ago

I am a new user trying to use Simba to detect changes in behavior on mice in the Barnes maze test. I loaded my DLC tracking data and set up ROIs without problem, but I could not create behavior annotations. I started labeling a 5min and 18000 frames video following the tutorial for behavioral annotator GUI. For this, I mark the behavior and the frame range checkbox and then annotate the first and last frame of the behavior. Then press the "save and advance to the next frame button" to continue with the next label. Finally, press the generate/save annotations and close the window to continue with the train machine label.

image

For this, I use the hyperparameters from the example file (BtWGaNP_meta) to train the machine model. But every time that try to make a model, the following error appears

"raise ValueError('Data for video {} does not contain any annotations for behavior {}'.format(vid_name, clf_name)) ValueError: Data for video D1_C9A2_cropped does not contain any annotations for behavior Explore"

(where D1_C9A2_cropped is my video an "Explore" the behavior)

image

¿what could be the problem? greetings and thanks in advance.

(running in Win 10 with anaconda) OS: Win 10

sronilsson commented 1 year ago

Hello @Gfernandezv! Thanks for the screengrabs, very helpful. From what I can see on the screengrabs, a video called D1_C9A1_cropped is annotated.

When you click on Train single model from global environment, SimBA pulls all of the video files that have been annotated. To find all the files that have been annotated, SimBA looks inside project_folder/csv/targets_inserted directory which is where the files are saved after clicking generate/save annotations in the annotation interface.

When SimBA looks inside the project_folder/csv/targets_inserted directory, in your case, we find 3 files. One is likely D1_C9A2_cropped, another is the D1_C9A1_cropped (which is the file I can see you annotating), and the third file I can't guess the name of.

Is it possible that that D1_C9A2_cropped and possibly a third file has been added to the project_folder/csv/targets_inserted directory without annotations? Annotations are stored as the last columns in these files. So if you open them up in a spreadsheet viewer (or alternative way if too large) and look at the last column, do you find a column called 'Explore' at the end of D1_C9A2_cropped?