talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
427 stars 97 forks source link

Add option to analysis export that will export predictions for all frames (including those with no predictions) #1651

Open roomrys opened 8 months ago

roomrys commented 8 months ago

Discussed in https://github.com/talmolab/sleap/discussions/1622

Originally posted by **vtsai881** December 3, 2023 Hello Team SLEAP! :) I was importing SLEAP prediction csvs into SimBA when I realized that there are missing rows for frames when there are no predictions (i.e. where the animal is not present or not being tracked). Ideally, those would just be extraneous frames at the beginning or ends of videos that could be clipped out during pre-processing before SLEAP and there would be SLEAP tracking for every frame in which the animal is present, but in the case that there is actually inconsistent tracking, is there currently a way to keep the number of rows in the output csv the same as the number of frames in the original video (i.e. maintaining the original frame indices by populating rows with NAs or 0s)? [I forked the repo and modified the `write_tracking_h5.py` and associated functions so that the `all_frames` argument does this](https://github.com/talmolab/sleap/compare/develop...vtsai881:sleap:develop), and added a button with the option to export a csv with rows for every frame to the dropdown menu. I'm still relatively new to the SLEAP workflow/datastructures, so I wanted to check if I missed something that already tackles this issue! I'm happy to open a PR If my changes make sense and aren't redundant! Thanks! Valerie 😄

Related: