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

Question about CSV files #381

Open fidelDLC opened 3 weeks ago

fidelDLC commented 3 weeks ago

Hello, I am using SimBA v.1.93.9 and I want to analyze locomotor activity on a single rat video and I would like to know whether it is posible to use a single CVS file to analyse several videos. I read the hypothetical scenarios and in all of them it is necesary to have a CSV file of every video I want to analyze. In this case, I understand that I will need to make the labelling process with clusters in DLC and then continue with SimBa. So, I was wondering if it is posible the .cvs file that I used to train the network to analyze the rest of the videos and skip the long DLC step.

Thank you.

sronilsson commented 3 weeks ago
I would like to know whether it is posible to use a single CVS file to analyse several videos

Hi @fidelDLC! I interpret this as asking if you can calculate locomotor activity in SimBA without performing pose-estimation first, is that correct? Can you please develop a little bit so I understand? It seems like you have a CSV with pose-estimation data for a single video, but you want to use that tracking data for a different video?

PS:

SimBA have some background removal tools that are not well advertised. This is how many commercial tools track movement. They work well for single animals, as long as (i) the animal isn't sitting still in the whole recording and (ii) there are no other changes beyond the position of the animal in the video. Just have to track e.g. center of the colored blob.

I could try to show you have to do that, if you only want to track locomotion in one rat and you don't want to go through pose-estimation-DLC as you only need the videos.

fidelDLC commented 2 weeks ago

Hi, I used SimBa to trained a model that recognize different rat behavior, groomig, rearing, etc. Then, I wanted to perform a analysis with another video to see if the trained network worked. I follow this guide and I realized that in every case I need the respective .csv file for each video I wanted to analyze. This .csv file is generated with DLC and it takes too much time. I do not understand how transfer learning works here, not in SimBa but in DLC to use the pretrained network to generate a .csv file of every single video. I know that you are not DLC but maybe you have a hint or something.

Thank you.

sronilsson commented 2 weeks ago

How much time does it take to analyze a video in DLC? How long are the videos, their resolution and FPS?

Typically, it should be relatively quick, once you've build a pose-estimation model and apply it to new videos. I've seen people having these difficulties, but it happens when they have have say recordings that are >100 hours.

fidelDLC commented 2 weeks ago

My videos aren´t too long, 10 min per video and it takes more than 5 hours to finish the training and obtain the .cvs file, without taking into consideration the time that I spend labelling the parts of the rat of every frame, this may not take that long. I´m trying to figure out how to use the pose-estimation model that I have already built or the checkpoints that are stored in a file. But honestly, I don´t know how I can make this process faster.

sronilsson commented 2 weeks ago

The labelling, and building the model should only be done once and is slow. Applying the model to new videos is much faster.

If training is slow, make sure that it is using your GPU and that tensorflow isn't running through your CPU.

But there should be plenty of documentation for how to get it running on new videos on the DLC pages.

fidelDLC commented 2 weeks ago

Ok, I´m gonna continue reading. Thank you