SainsburyWellcomeCentre / aeon_experiments

Experiment workflows for Project Aeon
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

SLEAP centroid-only and pose-only models don't work with Bonsai's 'PredictCentroids' aand 'PredictPoses' nodes, respectively #327

Open jkbhagatio opened 1 year ago

jkbhagatio commented 1 year ago

Currently, we can export a SLEAP v1.3.1 centroid+centered_instance for inference in Bonsai with the PredictPoseIdentities node using Bonsai's "Bonsai - SLEAP Library v0.2.0".

However, neither the centroid-only nor pose-only model exports work with the respective Bonsai PredictCentroids and PredictPoses nodes.

I used an adaptation of Bruno's code here to manually export the centroid-only and pose-only models (this cannot be done via SLEAP code currently: they only support exports of the stitched models). https://github.com/bruno-f-cruz/Sleap_export-Bonsai/blob/main/sleap_scripts/export_networks.ipynb

Using either SLEAP v1.3.1 or SLEAP v1.2.9, this code was able to extract a 'frozen_graph.pb' file from the model h5 file, but neither of these worked in Bonsai:

glopesdev commented 1 year ago

@jkbhagatio I think this was solved in the last couple of weeks, right? Feel free to close with any additional details. We can also open a different issue for documenting any specific SLEAP training steps that need to be in place for the tracking pipeline to work.