-
Hi, Is it possible to get instances labeled as "prediction without track identity" from an ".slp" file? At the moment I just convert from the .slp to the analysis hdf5 file like this: But I haven't found where these instances are stored. I'm interested in these instances, since they correctly fit the animal in those video frames, although for some reason (not the topic of the question) these are not assigned a track. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @adpala, Only instances with track identities are saved in the analysis hdf5. As you stated, you will need to navigate within the slp file directly. We have a data structures notebook which gives a few examples for how to navigate the data in your slp. Basically each slp file is contained within a Lines 390 to 426 in 57ee08a The Lines 1282 to 1292 in 57ee08a Each Lines 1431 to 1434 in 57ee08a Each Lines 344 to 367 in 57ee08a An (untested) MVP for your use case: import sleap
ds = "path/to/slp"
labels = sleap.load_file(ds)
lfs = labels.labeled_frames
instances_without_tracks = [inst for inst in lfs.predicted_instances if inst.track is None] Let us know if you need any extra assistance! Thanks, |
Beta Was this translation helpful? Give feedback.
Hi @adpala,
Only instances with track identities are saved in the analysis hdf5. As you stated, you will need to navigate within the slp file directly. We have a data structures notebook which gives a few examples for how to navigate the data in your slp.
Basically each slp file is contained within a
Labels
object.sleap/sleap/io/dataset.py
Lines 390 to 426 in 57ee08a