YttriLab / A-SOID

An active learning platform for expert-guided, data efficient discovery of behavior.
Other
55 stars 7 forks source link

'Key Error' in Refinement Step After the First Sample #84

Closed eacrummy closed 6 months ago

eacrummy commented 7 months ago

Describe the bug Key Error for Behaviors('Other', 'Platform Time') when trying to look at video segments to refine labels.

To Reproduce Steps to reproduce the behavior:

  1. Go to Refine Behaviors
  2. Update Refinements
  3. Scroll down to selector for samples 0,1,2,3,4 (etc.)
  4. See error following sample 0

Expected behavior Expected to be able to select samples 0-4 (based on number of samples to refine at 5) and see different video clips of example behavior to edit behavioral classification at those timepoints.

Screenshots

image image image image image

Desktop (please complete the following information):

Project Config (please post the content of the corresponding config.ini file)

image

Additional context Add any other context about the problem here.

JensBlack commented 7 months ago

Thank you @eacrummy for reporting this issue.

I'll investigate this on my side, but it would be great to get some additional information:

  1. Is this the first time you are refining in this project?
  2. Did refinement work for "Freezing"?
  3. Did refinement work for sample 0 in "Platform Time"?
  4. Did you save your refinement after refining sample 0 or any other sample?
  5. Did the error occur when you switched between behaviors? E.g., between the tabs "Freezing" and "Platform Time"
eacrummy commented 7 months ago

Hi Jens,

  1. Yes, this was my first attempt to refine with a new video uploaded to the project
  2. Freezing wasn't detected in this video 3., 4. Sample 0 seemed to work - I could edit the labels for each timepoint, but I didn't save it or other samples.
  3. Yes, the error occurred for multiple behaviors I switched between.

Thank you for your help! -Elizabeth

eacrummy commented 7 months ago

Hi Jens,

Not sure if this would explain the error, but we realized that we had to modify our Boris score time bins to match the 15 fps framerate of our videos. We also have portions of the video that start prior to session start for our behavior, so we think that the sleap predictions are excluding those frames and misaligning the Boris and pose estimation files.

Elizabeth

JensBlack commented 6 months ago

Hi @eacrummy ,

Thanks for your patience. Yes, this is likely the issue.

All exported BORIS files must have the same lenght (in time) as the pose estimation files. That means, that you need to export the binary table from the start of the "observation" (video), not the first behavior.

This should fix your issue, but please let me know if it did.

Feel free to close the issue.

eacrummy commented 6 months ago

Hi Jens,

Thank you! We did try to rebin the BORIS timestamps at to match the 15 fps of the videos, but had issues with matching the time. We're working on using larger timebins (.2s to be 5fps) to see if it fixes our issue.