-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Thank you for starting a new discussion! We appreciate your input and will review it soon. Warning A friendly reminder that this is a public forum. Please be cautious when clicking links, downloading files, or running scripts posted by others.
Stay safe and happy SLEAPing! Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi @davorvr, For sure! The easiest way would be to use I'd recommend installing it in a new environment if possible, but let us know if it gives you any issues if you prefer to do it in the We recently added some convenient functionality for exactly this situation via import sleap_io as sio
labels = sio.load_file("labels.v001.slp")
# Fix paths using prefixes.
labels.replace_filenames(prefix_map={
"D:/data/sleap_projects": "/home/user/sleap_projects",
"C:/Users/sleaper/Desktop/test": "/home/user/sleap_projects",
})
labels.save("labels.v002.slp") You can also give it a list of filenames ( Let us know if that works for you or if you have any questions! Cheers, Talmo |
Beta Was this translation helpful? Give feedback.
Hi @davorvr,
For sure! The easiest way would be to use
sleap-io
, our standalone library for working with SLP files exactly for this use case. Files saved withsleap-io
will work seamlessly with SLEAP and vice-versa.I'd recommend installing it in a new environment if possible, but let us know if it gives you any issues if you prefer to do it in the
sleap
env. It has bothpip
(recommended if doing it in thesleap
environment) andconda
(recommended if doing it in its own environment) packages.We recently added some convenient functionality for exactly this situation via
Labels.replace_filenames
. For example: