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
272 stars 137 forks source link

labelling behavior #357

Open fidelDLC opened 2 months ago

fidelDLC commented 2 months ago

Hi! I'm following the steps to train and run the machine model, but I got stuck in the label behavior step. When I click on select video (create new video annotation), it only open a window with the video and two options below (frame number and jump to select frame), with no lateral bar for checking behaviors and in the main window this appears:

ANNOTATING VIDEO raw_clip1 VIDEO INFO: {'video_name': 'raw_clip1', 'fps': 60, 'width': 1280, 'height': 720, 'frame_count': 7200, 'resolution_str': '1280 x 720', 'video_length_s': 120} USER FRAME SELECTION(S):

sronilsson commented 2 months ago

Thanks for reporting @fidelDLC - yes I can help. To troubleshoot, first can you tell me:

i) Which version of simba you are running - you can find out by typing pip show simba-uw-tf-dev in your environment here SimBA is installed.

ii) When this happens, do you see any error msg is the operating system terminal where you launched SimBA from?

Thanks!

fidelDLC commented 2 months ago

This is the SimBa version: Name: Simba-UW-tf-dev Version: 1.89.6

I launch SimBa from Anaconda Powershell and nothing appears when the annotation interface open imagen_2024-04-17_181749810

I looked for more detailed information and extracted video frames to continue with this step: under Label Behavior click on Select folder with frames but I found no such button and the closest one was IMPORT FRAMES DIRECTORY TO SIMBA PROJECT in the Further imports section, so, I selected the frame file and this appears in the main SimBa window

SIMBA DIRECTORY ALREADY EXIST ERROR: SIMBA ERROR: C:/Users/fisio/Programs\prueba4\project_folder\frames\input\raw_clip1 already exist in SimBA project. 🚨

And the same in the Anaconda Powershell

File "C:\Users\fisio\anaconda3\envs\SIMBA\lib\site-packages\simba\video_processors\video_processing.py", line 1657, in copy_img_folder source=copy_img_folder.name, simba.utils.errors.DirectoryExistError: SIMBA DIRECTORY ALREADY EXIST ERROR: SIMBA ERROR: C:/Users/fisio/Programs\prueba4\project_folder\frames\input\raw_clip1 already exist in SimBA project.

I know this file already exists in my simba files and it cannot be imported, so in this step I am completely lost .

Thanks.

sronilsson commented 2 months ago

Hi @fidelDLC !

First - can you give me a link to the documentation/tutorial you are following? I ask as there is no need to extract frames to perform labelling (although this was a requirement 5ish years ago) so you may be looking at documentation that is old and should be removed/updated. Sorry about that. To label behavior, try following THIS documentation and let me know how goes.

When you click the button to create a new video annotation, select a video file inside the project_folder/videos directory of your SimBA project:

image

Simon

fidelDLC commented 2 months ago

Hi! This is the documentation I followed. I started a new project and in the label behavior part I followed the documentation you send me and this happened in the SimBa terminal: image and the video annotation interface is the one that I send you before, the thing is that I want to figure out what do I have to do to get this window open: image

Sorry if I'm not clear enough. :S

sronilsson commented 2 months ago

Hi @fidelDLC! I kind of understand - when you click to open the annotation interface, you only see the left portion of the annotation interface, and the right portion is not showing appropriately.

If the right portion is not showing, there is likely to be due to an error that is not caught appropriately. This error may be shown in the operating system terminal, where you typed simba to launch SimBA.

I only have a Mac available at the moment, so will look slightly different aesthetically if you are on Windows.But in this video below and launch the annotation interface. Right at the end, I go back to the terminal which I use to launch the SimBA - do you see anything printed in this terminal after the right portion of the annotation interface fails to launch?

https://github.com/sgoldenlab/simba/assets/34761092/7aec4cb4-3d30-4a4e-9b5c-dbafb84ec043

fidelDLC commented 2 months ago

Hi There is no error in the terminal: image Maybe the problem is that I'm not using one of the pose estimation data that comes from default in SimBa and I created a user-defined pose configuration, but I have the .csv corresponding to the video. I'm not sure.

Thanks :S

sronilsson commented 2 months ago

Hi @fidelDLC - thanks for trying - no, that should not cause any issues. Its tricky to troubleshoot without error msgs. Is there any chance you could share your project with only a single video, through a gdrive or similar, and I can give it a try and hopefully I can recreate the error on my end?

fidelDLC commented 2 months ago

These are the files I´m using, These are from another github repo because I want to learn how to use SimBa before running my project (I'm starting at the lab). I'm gonna try with another video that I just took today.

Thank you!

sronilsson commented 2 months ago

Thanks I will take a look, I've requested access

fidelDLC commented 2 months ago

I'm sorry, I've already give you access. :D

sronilsson commented 2 months ago

I am not sure why, but when I click on the link I see this?

image

fidelDLC commented 2 months ago

My fault, that's it.

sronilsson commented 2 months ago

Got it!

sronilsson commented 2 months ago

I still don't know I'm sorry we have to do some more troubleshooting, it loads on my end...

image

Can you send me the project_config.ini associated with the project?

Can you also send me the CSV associated with raw_clip1 from the `project_folder/csv/features_extracted directory for your SImBA project?

fidelDLC commented 2 months ago

Hi, Thank you! The files are already in the drive. :D

sronilsson commented 2 months ago

Got it, still can't recreate it but will try a few more things and get bacj tou you - btw you have some great tracking going on this guy, do you mind if I use this data you shared for some example videos?

fidelDLC commented 2 months ago

Those are not my files, I took them from another program that I tried to install called B-SOID, but there wasn't enough information and I couldn't move forward, then I found SimBa. It is also an open source tracking program so I think there is no problem if you want to use it. Those files were made by DeepLabCut.

sronilsson commented 2 months ago

Alright, thanks!

I cannot replicate the error.. so just one question to be sure (as there are no error msgs). The video is large in pixels, are you sure the panels are not hidden somehow, outside the viewing area of your monitor if it is smaller, and you have to drag the window to see it as below?

https://github.com/sgoldenlab/simba/assets/34761092/ed8ca30b-4a16-4f5f-a22e-4fdca8618321

fidelDLC commented 2 months ago

That was the frist thing I thought because the window is so large, but I move it looking for hidden panels and found nothing... But now, I realized that in your video the image is bigger than mine in the right side where the options are suppose to be. Probably you are right, but I cannot expand it more. Gonna look for solutions. Any suggestion? hehe

Thank you :3 image

fidelDLC commented 2 months ago

Absolutely my bad, I changed my monitor and now I have the full view of the annotaton interface. Thank you!!

image

sronilsson commented 2 months ago

Ah! Cool. I was going to suggest maybe change the resolution in Microsoft Windows display settings, or maybe use videos with smaller resolution thats better suited for the monitor, raw_clip1.mp4 is 1280 x 720, maybe downsample it before annotating.

fidelDLC commented 2 months ago

I'm gonna take it into consideration. Thank you so much for your help. Hope to be able to handle the next steps from now on. :D