Skip to content

Exporting predicted xy locations without tracking? #1873

Answered by talmo
petermarting asked this question in Help!
Discussion options

You must be logged in to vote

Hi @petermarting,

Sure thing -- what format were you looking to export the individual instances to?

Using sleap-io, our standalone package for working with SLEAP data is the easiest route here, but basically you can do something like:

import sleap_io as sio

labels = sio.load_file("labels.v001.slp")

all_instances = []
for lf in labels:
    video_ind = labels.videos.index(lf.video)
    for inst in lf:
        all_instances.append({"video": video_ind, "frame": lf.frame_idx, "points": inst.numpy()})

The all_instances variable will be a list of dictionaries with your data which you can then convert or save out however you want. Just let us know what you're looking for and we can help you ada…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@petermarting
Comment options

Answer selected by petermarting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help!
Labels
None yet
2 participants