using a pre-existing model #1963
-
We have a tensorflow/keras model, already trained outside SLEAP, which we would like to use as a centroid detector in SLEAP. It's a Unet type architecture that takes grayscale frames as inputs and outputs score maps of the same shape (scores being float32 values between 0 and 1). How can I plug it into the SLEAP pipeline? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 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 @bjudkewitz, Are you trying to set up an inference pipeline with your own model for centroid detection and a SLEAP model for keypoints detection? Thanks! Divya |
Beta Was this translation helpful? Give feedback.
-
Hi Divya! Something like that, though not quite a pipeline. We just have a very reliable and sufficiently flexible centroid detector that was trained with much effort, so I'd like to re-use it for further work (centroid inference on new videos and also keypoint detection) in SLEAP. |
Beta Was this translation helpful? Give feedback.
Hi @bjudkewitz,
Right, the easiest would probably be to configure and train a centroid model as similar as possible to yours using the SLEAP GUI and then swap out the
best_model.h5
in the resulting with your own checkpoint.There's likely a good number of places where this will need to be adjusted since we make assumptions about layer names, shapes and ordering based on what we parse from the config, but it's a good starting point.
Give it a go and let us know if you run into any errors!
(Based on your experience, we may want to promote this to an enhancement proposal -- and we'd super appreciate contributions!)
Cheers,
Talmo