Max instance for Centroid-only model inference #2831
|
Hi, I am using sleap-nn predict with a centroid-only model trained to detect one point per individual. I ran the following command: However, the log shows: So it looks like --peak_threshold 0.1 and --max_instances 2 were not reflected in the actual inference settings. OS: Windows Thank you! |
Replies: 3 comments 1 reply
|
Your startup line is the key evidence: That means the values never reached the inference layer; it is not merely a display/output issue. Centroid-only propagation of I would first check which executable/version the Conda shell is actually using: where sleap-nn
sleap-nn --version
sleap-nn predict --helpThen upgrade that environment to a current release and retry: sleap-nn predict -i "D:/2023/DLC/Videos/20230627_pair24_01_pre_GoPro - Trim.mp4" -m "D:/2023/SLEAP/2026/models/nether-centroid-standalone-03-2" -o "D:/2023/SLEAP/2026/pair24_01_pre_centroid_predictions.slp" --device cuda:0 --batch_size 4 --peak_threshold 0.1 --max_instances 2In the current CLI, If it still reports the defaults, please paste |
|
Hey @Toach-2021 ! Thanks for filing this bug-- This has been addressed in talmolab/sleap-nn#709. The fix is on main but not in a release yet (we're planning a new sleap-nn release soon!). Since you're using a conda environment, you can install from main with: or by cloning the sleap-nn repo and installing from main as seen here in the sleap-nn docs Or with uv: After that, your original command should work as expected: The startup log should now show peak_threshold=0.1 | max_instances=2 instead of the defaults. Let us know if this works for you! Thanks, |
|
Hi Amick, Thank you very much for fixing this bug and for the detailed explanation! I installed the version from main and confirmed in my environment that Thank you again for your quick response and support. I really appreciate it! |
Hey @Toach-2021 !
Thanks for filing this bug--
--max_instancesand--peak_thresholdwere being silently ignored for centroid-only and top-down models due toCentroidLayerreading a frozen build-time value instead of the predict-time override set by--max_instances(the same bug was fixed for bottom-up models earlier in talmolab/sleap-nn#582, but the centroid layer was missed).This has been addressed in talmolab/sleap-nn#709. The fix is on main but not in a release yet (we're planning a new sleap-nn release soon!). Since you're using a conda environment, you can install from main with:
o…