Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export as analysis CSV or HDF5 requires tracks #1853

Open
mwinding opened this issue Jul 5, 2024 · 2 comments
Open

Export as analysis CSV or HDF5 requires tracks #1853

mwinding opened this issue Jul 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mwinding
Copy link

mwinding commented Jul 5, 2024

Bug description

Exporting as an analysis CSV or HDF5 only works if you have predictions and have run tracking. If you just want predictions without tracking on SLEAP, the CSV or HDF5 will only export a single instance, even if you have dozens of predicted instances. This occurs using the export functions on the GUI, as well as using sleap-convert on commandline.

As an example, I predicted the first few frames of a video via commandline with or without tracking, and then exported as CSV.

Expected behaviour

In the video provided, there should be roughly 30 instances per frame. If I perform tracking after prediction, I see roughly 30 instances per frame in the analysis CSV as expected.

Screenshot 2024-07-05 at 11 00 54

tracks.analysis.csv

Actual behaviour

But if I only run predictions and then export to an analysis CSV, I see only a single instance per frame. I suspect the issue is that the tracks column is blank and this is assumed to be populated in the export scripts

Screenshot 2024-07-05 at 11 02 09

no-tracks.analysis.csv

Your personal set up

I have tried this on macOS using the export option in the GUI of sleap-label and on a linux-based HPC using sleap-convert on commandline. I suspect the specific details of the OS isn't important here. I can provide more details if you cannot replicate the bug.

I have tried this both for .h5 and .CSV analysis export. Same issue.

@mwinding mwinding added the bug Something isn't working label Jul 5, 2024
@mwinding
Copy link
Author

mwinding commented Jul 5, 2024

Software versions:
SLEAP: 1.3.3
TensorFlow: 2.9.2
Numpy: 1.22.4
Python: 3.9.15

@talmo
Copy link
Collaborator

talmo commented Jul 23, 2024

Hi @mwinding,

Apologies for the long delay!!

We do assume that there are tracks for exporting, but it's very possible to convert untracked data to whatever format you're looking for using the sleap-io API for convenience.

Here's a notebook that should do the trick.

Let us know if that works for you!

Cheers,

Talmo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants