Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing BORIS annotations #391

Open
Monica9577 opened this issue Sep 16, 2024 · 18 comments
Open

Importing BORIS annotations #391

Monica9577 opened this issue Sep 16, 2024 · 18 comments

Comments

@Monica9577
Copy link

I'm trying to create a classifier, for that I'm trying to import previously manually annotated data from boris.
But it doesn't seem to be working properly, because as far as I understood, if I have 6 videos manually annotated SIMBA should create 6 .csv files in \project_folder\csv\targets_inserted

Maybe I'm doing something wrong, I'll be very glad to get any help.

  • Steps to reproduce the behavior:
  1. On BORIS go to "project" and open the desired project file
  2. Then go to "observations" window and select "export events" as "aggregated events" (I think this is the part I'm doing wrong)
  3. Save the results as .csv
  4. Go to SIMBA (version: 2.1.2)
  5. Go to label behaviour and choose "import third-party behaviour annotations" from BORIS

Expected behavior
After analyzing I expected to see in my \project_folder\csv\targets_inserted the 6 .csv files corresponding to my manually annotated data.
Instead I still have the same 2 .csv files I originally did with the usual labeling tools inside SIMBA

Desktop (please complete the following information):

  • OS: Windows 11
  • Are you using anaconda? YES
  • SIMBA version: 2.1.2
  • BORIS version: 8.25.4

ADDITIONAL
I'm attaching the file I imported to simba ("prueba aggregated events.csv)
And the .txt file of my project configuration file ("project -copia.txt)

project - copia.txt

prueba aggregated events.csv

@sronilsson
Copy link
Collaborator

Hi @Monica9577!

This appears to be related to the issue reported last week, check THIS reply.

It's to do with the layout of your BORIS file versus the layout expected by SimBA. The BORIS layout you have - do you know if that is a new "standard" output from BORIS, or is it one of many alternatives?

@Monica9577
Copy link
Author

Captura de pantalla 2024-09-16 204556
It is one of many alternatives. I choosed "export events as aggregated" because is the one that seemed the most similar to the example file in the SIMBA "tutorial"

Which option is better to choose?

Thanks so much for your help and your quick response

@sronilsson
Copy link
Collaborator

Thanks for the screengrab very helpful. Can you see what you get when exporting tabular events?

You are looking for data organized with start and end events on separate rows like in this attached file, not data where each row is both a start and stop event.

boris_new_example.zip

@Monica9577
Copy link
Author

With tabular it gives me the following document
tabular trial.csv
Still not correct, when using it for import third-party annotations, it says the following error "No BORIS annotations detected for SimBA classifier(s) named ['FREEZING'] for video AC1 F1" when I'm sure those videos are annotated
image

@sronilsson
Copy link
Collaborator

That BORIS file certainly looks more promising.

However, in BORIS you may have named your behavior Freezing and in SimBA you named it FREEZING. If you rename the behavior to match the capitalization versus sentence case, how does it work?

@Monica9577
Copy link
Author

Hi Simon,
When I rename the behavior to match the capitalization, it works better, at least recognizes which videos are manually annotated. But the following error shows up in the main console (Attached image, also attached a written version) and the program stays in that state, that never completes (attached image)
Captura de pantalla 2024-09-17 134627
Captura de pantalla 2024-09-17 134402
ERROR WHEN IMPORTING ANNOTATION.docx

@sronilsson
Copy link
Collaborator

sronilsson commented Sep 17, 2024

Thanks @Monica9577, super helpful. I can see what is going on - you see that in your BORIS file, you have several FPS associated with each row:

30.000;30.000;30.000;30.000;30.000;30.000;30.000

Whereas in the file I attached above as the expected input, has a single FPS value associated each row:

59.94.

What I will do is to update the SimBA code so it can handle your data format, as well as the expected data format. I will get back to you in a min.

Thanks
Simon

@sronilsson
Copy link
Collaborator

@Monica9577 - let's try again and let me know if you see any errors.

How does it look if you update simba to version 2.1.6 with pip install simba-uw-tf-dev --upgrade and try it?

@Monica9577
Copy link
Author

@sronilsson After updating it looks promising, but still some problems

I'm attaching a screenshot of the simba interface and the main console

Captura de pantalla 2024-09-18 142002
ERROR IMPORTING BORIS .docx

@sronilsson
Copy link
Collaborator

Hi @Monica9577 - yes I can see where the warning comes from, lets see what I can do.

There is some oddeties in there that freaks SimBA out:

For example, in video AC1 F6 , subject F5 starts to freeze, and it doesn't stop to freeze until the end of that video?

image

Do you know if there is any setting in BORIS that allows you to save the data as individual CSVs for each video that you annotated?

@sronilsson
Copy link
Collaborator

@Monica9577 if you update SimBA again, I've inserted some code to try catch and fix such inconsistencies in the BORIS file, but I haven't tested it extensively, so if you do try it let me know how it goes.

@Monica9577
Copy link
Author

Thanks, now it imported the annotation files
but when trying to train the model this error appears (adjunted document) and simba program collapses
Uploading PROBLEM IN TRAINING MODEL.docx…

@sronilsson
Copy link
Collaborator

Hi @Monica9577 - can you check that the Problem in training document is actually linking to the correct file?

@Monica9577
Copy link
Author

for some reason I can't opened, so I'm uploading it again
PROBLEM IN TRAINING MODEL.docx

@sronilsson
Copy link
Collaborator

Thanks @Monica9577 - can you also show me your project_config.ini? You may have to zip it before dropping it in this thread.

@Monica9577
Copy link
Author

project_config.zip
Yes of course, here it is, I'm also attaching one of the targets_inserted files created after importing BORIS annotations
AC1 F2.zip

@sronilsson
Copy link
Collaborator

Got it - looking at the name of the classifier you want to train it is set to None in your ptoject config on line 36:

image

This value is set in the SimBA interface when you use this menu to save how you want to train your classifier.

Screenshot 2024-09-19 083514

You can either: (i) use the menu above as docuumented HERE, click save, and run the model, (ii) or if you just want to test it out, change None -> Freezing manually in the project_config on line 36, save the file, and run the training.

@Monica9577
Copy link
Author

Thanks so much for your help @sronilsson now it's working like fine wine !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants