Releases: talmolab/sleap-nn
v0.1.0a4
v0.1.0a4 Release Notes
Summary
This pre-release focuses on bug fixes, performance improvements, and CLI usability enhancements:
- Simpler Train CLI: New
--configflag and positional config support forsleap-nn train - 17-51x Faster Peak Refinement: Replaced kornia-based cropping with fast tensor indexing
- ConvNext/SwinT Bug Fix: Fixed skip connection channel mismatch that broke training with these backbones
- GUI Integration: New
--guiflag for SLEAP frontend progress reporting
For the full list of major features, breaking changes, and improvements introduced in the v0.1.0 series, see the v0.1.0a0 release notes.
What's New in v0.1.0a4
Features
Simplified Train CLI (#429)
Training can now be started with a single config file path:
# NEW: Positional config path
sleap-nn train path/to/config.yaml
# NEW: --config flag
sleap-nn train --config path/to/config.yaml
# With Hydra overrides
sleap-nn train config.yaml trainer_config.max_epochs=100
# Legacy flags still work
sleap-nn train --config-dir /path/to/dir --config-name myconfigThe CLI now uses rich-click for styled help output with better formatting and readability.
GUI Progress Mode (#424)
New --gui flag enables JSON progress output for SLEAP GUI integration:
sleap-nn track --data_path video.mp4 --model_paths model/ --guiOutput format:
{"n_processed": 100, "n_total": 1410, "rate": 38.4, "eta": 34.1}
{"n_processed": 200, "n_total": 1410, "rate": 39.2, "eta": 30.8}This enables real-time progress updates when running inference from the SLEAP GUI.
Performance
17-51x Faster Peak Refinement (#426)
Replaced kornia's crop_and_resize with fast tensor indexing for peak refinement:
| Platform | Before | After | Speedup |
|---|---|---|---|
| MPS (M-series Mac) | 21.45 ms | 0.42 ms | 51x |
| CUDA (RTX A6000) | 2.64 ms | 0.15 ms | 17x |
This also enables integral refinement on Mac - the MPS workaround that disabled it has been removed.
Bug Fixes
ConvNext/SwinT Skip Connection Fix (#428)
Fixed RuntimeError: Given groups=1, weight of size [X, Y, 3, 3], expected input to have Y channels when training with ConvNext or SwinT backbones.
What was broken: Training with ConvNext/SwinT backbones crashed during validation due to channel mismatch in skip connections. The decoder assumed skip channels matched computed decoder filters, but ConvNext/SwinT encoder stages have different channel counts.
Impact: Users can now successfully train models with ConvNext and SwinT backbones. All 24 architecture tests pass.
Crop Device Mismatch Fix (#429)
Fixed RuntimeError: indices should be either on cpu or on the same device as the indexed tensor during top-down inference when bboxes tensor was on GPU but images were on CPU.
CSV Learning Rate Logging Fix (#423)
Fixed regression from v0.1.0a2 where learning_rate column in training_log.csv was always empty.
What was broken: PR #417 changed learning rate logging from lr-Adam to train/lr, but the CSV logger only checked for the old format.
Now: The CSV logger checks for train/lr (new format), lr-* (legacy), and learning_rate (direct) in that order. Also adds model-specific loss columns for better parity with wandb logging.
GUI Progress 99% Fix (#429)
Fixed inference progress ending at 99% instead of 100% in GUI mode. The throttled progress reporting was skipping the final update.
Documentation
Prerelease Docs Alias (#425)
Pre-release documentation is now accessible at both:
- Version-specific:
https://sleap.ai/sleap-nn/v0.1.0a4/ - Alias:
https://sleap.ai/sleap-nn/prerelease/
Internal
Test Suite Optimization (#427)
Optimized the 10 slowest tests for faster CI runs:
| Test | Before | After | Improvement |
|---|---|---|---|
| test_main_cli | 54.44s | 21.76s | 60% |
| test_bottomup_predictor | 6.71s | 1.76s | 74% |
| test_predict_main | 15.97s | 5.35s | 67% |
Total estimated savings: ~55% reduction for slowest tests.
Installation
This is an alpha pre-release. Pre-releases are excluded by default per PEP 440 - you must explicitly opt in.
Install with uv (Recommended)
# With --prerelease flag (requires uv 0.9.20+)
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow
# Or pin to exact version
uv tool install "sleap-nn[torch]==0.1.0a4" --torch-backend autoRun with uvx (One-off execution)
uvx --from "sleap-nn[torch]" --prerelease=allow --torch-backend auto sleap-nn systemVerify Installation
sleap-nn --version
# Expected output: 0.1.0a4
sleap-nn system
# Shows full system diagnostics including GPU infoUpgrading from v0.1.0a3
If you already have v0.1.0a3 installed with --prerelease=allow:
# Simple upgrade (retains original settings like --prerelease=allow)
uv tool upgrade sleap-nnTo force a complete reinstall:
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow --forceChangelog
| PR | Category | Title |
|---|---|---|
| #423 | Bug Fix | Fix CSV logger not capturing learning_rate |
| #424 | Feature | Add --gui flag for JSON progress output in inference |
| #425 | Documentation | Add prerelease alias to docs deployment |
| #426 | Performance | Replace kornia crop_and_resize with fast tensor indexing |
| #427 | Internal | Optimize slow tests for faster CI runs |
| #428 | Bug Fix | Fix skip connection channel mismatch in ConvNext/SwinT decoders |
| #429 | Feature | Add --config flag for simpler train CLI + fix crop device mismatch |
Full Changelog: v0.1.0a3...v0.1.0a4
v0.1.0a3
Summary
This pre-release adds powerful new capabilities for high-performance inference and post-processing:
- ONNX/TensorRT Export: Export trained models to optimized formats for 3-6x faster inference
- Post-Inference Filtering: Remove overlapping/duplicate predictions using IOU or OKS similarity
- Improved WandB Logging: Better metrics organization and run naming
For the full list of major features, breaking changes, and improvements introduced in the v0.1.0 series, see the v0.1.0a0 release notes.
What's New in v0.1.0a3
Features
ONNX/TensorRT Export Module (#418)
A complete model export system for high-performance inference:
# Export to ONNX
sleap-nn export /path/to/model -o exports/my_model --format onnx
# Export to both ONNX and TensorRT FP16
sleap-nn export /path/to/model -o exports/my_model --format both
# Run inference on exported model
sleap-nn predict exports/my_model video.mp4 -o predictions.slpPerformance Benchmarks (NVIDIA RTX A6000):
Batch size 1 (latency-optimized):
| Model | Resolution | PyTorch | ONNX-GPU | TensorRT FP16 | Speedup |
|---|---|---|---|---|---|
| single_instance | 192×192 | 1.8 ms | 1.3 ms | 0.31 ms | 5.9x |
| centroid | 1024×1024 | 2.5 ms | 2.7 ms | 0.77 ms | 3.2x |
| topdown | 1024×1024 | 11.4 ms | 9.7 ms | 2.31 ms | 4.9x |
| bottomup | 1024×1280 | 12.3 ms | 9.6 ms | 2.52 ms | 4.9x |
| multiclass_topdown | 1024×1024 | 8.3 ms | 9.1 ms | 1.84 ms | 4.5x |
| multiclass_bottomup | 1024×1024 | 9.4 ms | 9.4 ms | 2.64 ms | 3.6x |
Batch size 8 (throughput-optimized):
| Model | Resolution | PyTorch | ONNX-GPU | TensorRT FP16 | Speedup |
|---|---|---|---|---|---|
| single_instance | 192×192 | 3,111 FPS | 3,165 FPS | 11,039 FPS | 3.5x |
| centroid | 1024×1024 | 453 FPS | 474 FPS | 1,829 FPS | 4.0x |
| topdown | 1024×1024 | 94 FPS | 122 FPS | 525 FPS | 5.6x |
| bottomup | 1024×1280 | 113 FPS | 121 FPS | 524 FPS | 4.6x |
| multiclass_topdown | 1024×1024 | 127 FPS | 145 FPS | 735 FPS | 5.8x |
| multiclass_bottomup | 1024×1024 | 116 FPS | 120 FPS | 470 FPS | 4.1x |
Speedup is relative to PyTorch baseline.
Supported model types:
- Single Instance, Centroid, Centered Instance
- Top-Down (combined centroid + instance)
- Bottom-Up (multi-instance with PAF grouping)
- Multi-class Top-Down and Bottom-Up (with identity classification)
New CLI commands:
sleap-nn export- Export models to ONNX/TensorRTsleap-nn predict- Run inference on exported models
New optional dependencies:
uv pip install "sleap-nn[export]" # ONNX CPU inference
uv pip install "sleap-nn[export-gpu]" # ONNX GPU inference
uv pip install "sleap-nn[tensorrt]" # TensorRT supportSee the Export Guide for full documentation.
Post-Inference Filtering for Overlapping Instances (#420)
New capability to remove duplicate/overlapping pose predictions after model inference:
# Filter with IOU method (default)
sleap-nn track -i video.mp4 -m model/ --filter_overlapping
# Use OKS method with custom threshold
sleap-nn track -i video.mp4 -m model/ \
--filter_overlapping \
--filter_overlapping_method oks \
--filter_overlapping_threshold 0.5New CLI options for sleap-nn track:
| Option | Default | Description |
|---|---|---|
--filter_overlapping |
False |
Enable filtering using greedy NMS |
--filter_overlapping_method |
iou |
Similarity method: iou (bbox) or oks (keypoints) |
--filter_overlapping_threshold |
0.8 |
Similarity threshold (lower = more aggressive) |
Programmatic API:
from sleap_nn.inference.postprocessing import filter_overlapping_instances
labels = filter_overlapping_instances(labels, threshold=0.5, method="oks")Why use this? Previously, IOU-based filtering only existed in the tracking pipeline. This feature allows filtering overlapping predictions without requiring --tracking.
Improvements
WandB Run Naming and Metrics Logging (#417)
- Fixed run naming: WandB runs now correctly use auto-generated run names
- Improved metrics organization: All metrics use
/separator for automatic panel grouping in WandB UI:train/loss,train/lr- Training metrics (epoch x-axis)val/loss- Validation metrics (epoch x-axis)eval/val/- Epoch-end evaluation metricseval/test.X/- Post-training test set metrics
- New metrics logged:
train/lr- Learning rate (useful for monitoring LR schedulers)PCK@5,PCK@10- PCK at 5px and 10px thresholdsdistance/p95,distance/p99- Additional distance percentiles
Documentation
- Exporting Guide (#419): Added comprehensive export documentation to How-to guides navigation
Installation
This is an alpha pre-release. Pre-releases are excluded by default per PEP 440 - you must explicitly opt in.
Install with uv (Recommended)
# With --prerelease flag (requires uv 0.9.20+)
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow
# Or pin to exact version
uv tool install "sleap-nn[torch]==0.1.0a3" --torch-backend autoRun with uvx (One-off execution)
uvx --from "sleap-nn[torch]" --prerelease=allow --torch-backend auto sleap-nn systemVerify Installation
sleap-nn --version
# Expected output: 0.1.0a3
sleap-nn system
# Shows full system diagnostics including GPU infoUpgrading from v0.1.0a2
If you already have v0.1.0a2 installed with --prerelease=allow:
# Simple upgrade (retains original settings like --prerelease=allow)
uv tool upgrade sleap-nnTo force a complete reinstall:
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow --forceChangelog
| PR | Category | Title |
|---|---|---|
| #417 | Improvement | Fix wandb run naming and improve metrics logging |
| #418 | Feature | Add ONNX/TensorRT export module |
| #419 | Documentation | Add Exporting guide to How-to guides section |
| #420 | Feature | Add post-inference filtering for overlapping instances |
Full Changelog: v0.1.0a2...v0.1.0a3
v0.1.0a2
Summary
This pre-release adds real-time evaluation metrics during training and improves video matching robustness in the evaluation pipeline:
- Epoch-End Evaluation: New metrics logged to WandB at the end of each validation epoch (mOKS, mAP, mAR, PCK, distance metrics)
- Robust Video Matching: Improved evaluation video matching using sleap-io's
Labels.match()API
For the full list of major features, breaking changes, and improvements introduced in the v0.1.0 series, see the v0.1.0a0 release notes.
What's New in v0.1.0a2
Features
-
Epoch-End Evaluation Metrics (#414): Real-time evaluation metrics are now computed at the end of each validation epoch and logged to WandB. This enables monitoring training quality without waiting for post-training evaluation.
New metrics logged:
Metric Description val_mOKSMean Object Keypoint Similarity [0-1] val_oks_voc_mAPVOC-style mean Average Precision [0-1] val_oks_voc_mARVOC-style mean Average Recall [0-1] val_avg_distanceMean Euclidean distance error (pixels) val_p50_distanceMedian Euclidean distance error (pixels) val_mPCKMean Percentage of Correct Keypoints [0-1] val_visibility_precisionPrecision for visible keypoint detection val_visibility_recallRecall for visible keypoint detection Enable in your training config:
trainer_config: eval: enabled: true # Enable epoch-end evaluation frequency: 1 # Evaluate every epoch (or higher for less frequent) oks_stddev: 0.025 # OKS standard deviation parameter
Improvements
- Robust Video Matching in Evaluation (#415): The evaluation module now uses sleap-io's
Labels.match()API for more robust video matching between ground truth and prediction labels. This fixes several common failure scenarios:- Embedded videos (
.pkg.slp) with different internal paths - Cross-platform path differences (Windows vs Linux)
- Renamed or moved video files
- Embedded videos (
Bug Fixes
- Embedded video handling (#414):
get_instances()now correctly handles embedded videos that lackbackend.filenameattributes, preventing errors during evaluation. - Centroid model ground truth matching (#414): Centroid models now properly match centroids to ground truth instances for epoch-end evaluation.
- Bottom-up training stability (#414): Added
max_peaks_per_node=100guardrail to prevent combinatorial explosion when noisy early-training confidence maps produce spurious peaks.
Dependencies
- sleap-io: Minimum version bumped from
>=0.6.0to>=0.6.2forLabels.match()API support
Installation
This is an alpha pre-release. Pre-releases are excluded by default per PEP 440 - you must explicitly opt in.
Install with uv (Recommended)
# With --prerelease flag (requires uv 0.9.20+)
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow
# Or pin to exact version
uv tool install "sleap-nn[torch]==0.1.0a2" --torch-backend autoRun with uvx (One-off execution)
uvx --from "sleap-nn[torch]" --prerelease=allow --torch-backend auto sleap-nn systemVerify Installation
sleap-nn --version
# Expected output: 0.1.0a2
sleap-nn system
# Shows full system diagnostics including GPU infoUpgrading from v0.1.0a1
If you already have v0.1.0a1 installed with --prerelease=allow:
# Simple upgrade (retains original settings like --prerelease=allow)
uv tool upgrade sleap-nnTo force a complete reinstall:
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow --forceChangelog
| PR | Category | Title |
|---|---|---|
| #414 | Feature | Add epoch-end evaluation metrics to WandB logging |
| #415 | Improvement | Use sleap-io Labels.match() API for robust video matching in evaluation |
Full Changelog: v0.1.0a1...v0.1.0a2
v0.1.0a1
Summary
This pre-release is a minor update to v0.1.0a0 with quality-of-life improvements for training workflows:
- Progress Feedback: Rich progress bar during dataset caching eliminates the "freeze" after startup
- Disk Space Management: Automatic cleanup of WandB local logs (saves GB of disk space per run)
For the full list of major features, breaking changes, and improvements introduced in the v0.1.0 series, see the v0.1.0a0 release notes.
What's New in v0.1.0a1
Features
- WandB Local Log Cleanup (#412): Added
delete_local_logsoption toWandBConfigthat automatically deletes the localwandb/folder after training completes. By default, logs are automatically deleted when syncing online and kept when logging offline. This can save several GB of disk space per training run. Settrainer_config.wandb.delete_local_logs=falseto keep local logs.
Improvements
- Training Startup Progress Bar (#411): Added a rich progress bar during dataset caching to provide visual feedback during training startup. Previously, there was no indication while images were being cached to disk or memory after the "Input image shape" log message.
- Simplified Log Format (#411): Cleaned up log output by removing module names and log level fields for more user-friendly output.
Installation
This is an alpha pre-release. Pre-releases are excluded by default per PEP 440 - you must explicitly opt in.
Install with uv (Recommended)
# With --prerelease flag (requires uv 0.9.20+)
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow
# Or pin to exact version
uv tool install "sleap-nn[torch]==0.1.0a1" --torch-backend autoRun with uvx (One-off execution)
uvx --from "sleap-nn[torch]" --prerelease=allow --torch-backend auto sleap-nn systemVerify Installation
sleap-nn --version
# Expected output: 0.1.0a1
sleap-nn system
# Shows full system diagnostics including GPU infoUpgrading from v0.1.0a0
If you already have v0.1.0a0 installed with --prerelease=allow:
# Simple upgrade (retains original settings like --prerelease=allow)
uv tool upgrade sleap-nnTo force a complete reinstall:
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow --forceChangelog
| PR | Category | Title |
|---|---|---|
| #411 | Improvement | Improve logging during training startup |
| #412 | Feature | Add option to clean up wandb local logs after training |
Full Changelog: v0.1.0a0...v0.1.0a1
v0.1.0a0
Summary
This pre-release introduces major improvements to sleap-nn including simplified installation, enhanced training controls, comprehensive inference provenance, and significant performance optimizations. It also includes several breaking changes that warrant testing before the stable v0.1.0 release.
Key highlights:
- Simplified Installation: New
--torch-backend autoflag for automatic GPU detection - CUDA 13.0 Support: Full support for latest CUDA version
- GPU-accelerated Inference: Up to 50% faster inference via GPU normalization
- Provenance Tracking: Full reproducibility metadata in output SLP files
- Enhanced Training Controls: Independent augmentation probabilities, auto crop padding
- System Diagnostics: New
sleap-nn systemcommand for troubleshooting
Installation
This is an alpha pre-release. Pre-releases are excluded by default per PEP 440 - you must explicitly opt in.
Install with uv (Recommended)
# With --prerelease flag (requires uv 0.9.20+)
uv tool install sleap-nn[torch] --torch-backend auto --prerelease=allow
# Or pin to exact version
uv tool install "sleap-nn[torch]==0.1.0a0" --torch-backend autoInstall with uvx (One-off execution)
uvx --from "sleap-nn[torch]" --prerelease=allow --torch-backend auto sleap-nn systemInstall with pip
pip install --pre sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128Verify Installation
sleap-nn --version
# Expected output: 0.1.0a0
sleap-nn system
# Shows full system diagnostics including GPU infoBreaking Changes
1. Crop Size Semantics for Top-Down Models (PR #381)
Impact: High - affects model training and inference
The scaling behavior for top-down (centered-instance) models has changed:
| Aspect | Old Behavior | New Behavior |
|---|---|---|
| Order | Resize full image first, then crop | Crop first, then resize |
crop_size meaning |
Region size in scaled coordinates | Region size in original image coordinates |
Migration: Review your crop_size configuration values. Previously trained models may produce different results.
2. Model Run Folder File Naming (PR #408)
Impact: Medium - affects scripts that read model outputs
File naming conventions standardized:
| Old Pattern | New Pattern |
|---|---|
labels_train_gt_0.slp |
labels_gt.train.0.slp |
labels_val_gt_0.slp |
labels_gt.val.0.slp |
pred_train_0.slp |
labels_pr.train.0.slp |
pred_val_0.slp |
labels_pr.val.0.slp |
train_0_pred_metrics.npz |
metrics.train.0.npz |
val_0_pred_metrics.npz |
metrics.val.0.npz |
3. load_metrics() API Changes (PR #409)
Impact: Low - affects programmatic metrics loading
| Change | Old | New |
|---|---|---|
| Parameter name | model_path |
path |
| Default split | "val" |
"test" |
4. Video Path Mapping CLI Syntax (PR #389)
Impact: Low - affects CLI users with path remapping
# Old syntax (no longer works)
sleap-nn train -c config --video-path-map "/old/path->/new/path"
# New syntax
sleap-nn train -c config --video-path-map /old/path /new/pathPerformance Improvements
GPU-Accelerated Normalization (PR #406)
Image normalization now runs on GPU, reducing PCIe bandwidth by 4x.
| Image Size | Before | After | Speedup |
|---|---|---|---|
| 1024x1280 grayscale | 55.2 FPS | 64.7 FPS | 17% |
| 3307x3304 RGB | 6.7 FPS | 10.1 FPS | 50% |
New Features
- Simplified Installation (PR #405):
uv tool install sleap-nn[torch] --torch-backend auto - CUDA 13.0 Support (PR #405): New
--torch-backend cu130option - System Diagnostics (PR #391):
sleap-nn systemcommand and--versionflag - Provenance Metadata (PR #407): Full reproducibility tracking in output SLP files
- Video Path Remapping (PR #387, #389): Remap paths at training time
- Frame Filtering (PR #396, #397):
--exclude_user_labeledand--only_predicted_frames - Enhanced Data Pipeline (PR #394): Auto crop padding, independent augmentation probabilities
- Multiple Test Files (PR #383): Evaluate against multiple test datasets
- Enhanced WandB (PR #393, #395, #401): Interactive visualizations, per-head loss logging
- Centroid Confmaps (PR #386): Return centroid confidence maps in top-down inference
Bug Fixes
- #382: Fixed max_instances handling in centroid-only inference
- #385: Fixed crash on frames with empty instances
- #395: Fixed WandB visualization issues
- #397: Fixed
--exclude_user_labeledbeing ignored with--video_index - #401: Fixed PAF visualization scaling
- #402: Fixed WandB deprecation warning
- #394: Fixed user_instances_only handling bugs
Improvements
- #380: Use sleap-io built-in video matching methods
- #390: Added CLI reference page and Colab notebooks to docs
- #392: Run folders cleaned up when training canceled via GUI
- #398: Comprehensive test coverage improvements
- #400: WandB URL reported via ZMQ on train start
- #403: Migrated dev deps to PEP 735 dependency-groups
Changelog
| PR | Category | Title |
|---|---|---|
| #380 | Improvement | Use sleap-io built-in video matching methods |
| #381 | Breaking | Fix crop size behavior for top-down models |
| #382 | Fix | Fix max_instances handling in centroid-only inference |
| #383 | Feature | Support list of paths for test_file_path |
| #384 | Feature | Add source image to FindInstancePeaksGroundTruth output |
| #385 | Fix | Fix running inference on frames with empty instances |
| #386 | Feature | Return centroid confmaps when running topdown inference |
| #387 | Feature | Add video path remapping options to train CLI |
| #389 | Breaking | Fix train CLI path replacement syntax |
| #390 | Docs | Add CLI reference page and Colab notebooks |
| #391 | Feature | Add system diagnostics command and --version flag |
| #392 | Fix | Clean up run folder when training is canceled via GUI |
| #393 | Feature | Improve wandb visualization with slider support |
| #394 | Feature | Enhance data pipeline with auto crop padding |
| #395 | Fix | Fix wandb visualization issues |
| #396 | Feature | Add --exclude_user_labeled and --only_predicted_frames flags |
| #397 | Fix | Fix --exclude_user_labeled flag being ignored with --video_index |
| #398 | Tests | Add comprehensive test coverage |
| #400 | Feature | Report WandB URL via ZMQ on train start |
| #401 | Feature | Add per-head loss logging and fix PAF visualization |
| #402 | Fix | Fix wandb deprecation warning |
| #403 | Improvement | Move dev dependencies to PEP 735 dependency-groups |
| #405 | Feature | Add CUDA 13 support and simplify installation |
| #406 | Performance | Optimize inference by deferring normalization to GPU |
| #407 | Feature | Add provenance metadata to inference output SLP files |
| #408 | Breaking | Standardize model run folder file naming |
| #409 | Breaking | Improve load_metrics with format compatibility |
Full Changelog: v0.0.5...v0.1.0a0
SLEAP-NN v0.0.5
Summary
This release includes important bug fixes, usability improvements, and configuration enhancements. Key highlights include automatic video-specific output naming for multi-video predictions, improved progress tracking, better handling of edge cases in configuration files, and enhanced security for API key storage.
Major changes
New Features
Progress Bar for Tracking (#366)
Added visual progress tracking during tracking operations, providing real-time feedback on tracking progress for better user experience.
Video-Specific Output Paths (#378)
When running inference with the video_index parameter on multi-video .slp files, output files now automatically include the video name to prevent overwrites. Previously, all predictions would save to the same path (e.g., labels.predictions.slp), requiring users to
manually specify unique output paths. Now, predictions are saved with the format <labels_file>.<video_name>.predictions.slp, enabling seamless batch processing of multiple videos from the same project file.
Bug Fixes
Resume Checkpoint Mapping (#370)
Fixed checkpoint mapping when resuming training from PyTorch model checkpoints, ensuring proper state restoration for torch models.
Metrics Format Compatibility (#371)
Updated metrics saving format to match SLEAP 1.4 specifications and eliminated code duplication in metrics handling, ensuring cross-compatibility between SLEAP-NN and SLEAP 1.4.
Configuration Parameter Handling (#377)
Improved handling of run_name and ckpt_dir configuration parameters when set to empty strings or the string literal "None" in YAML files. This prevents unexpected behavior and ensures consistent defaults are applied.
Security Improvements
API Key Protection (#372)
WandB API keys are now automatically masked when saving initial_config.yaml files, preventing accidental exposure of sensitive credentials in saved configurations.
Configuration & Training Improvements
Optimized Default Parameters (#374, #375)
Updated default trainer configuration parameters based on extensive training experiments, improving training stability and convergence behavior out of the box.
Documentation
Dependency Update Instructions (#376)
Added comprehensive instructions for updating dependencies across all installation methods (GPU, CPU, and Apple Silicon), making it easier for users to maintain up-to-date environments.
Changelog
- Add progress bar to tracker by @gitttt-1234 in #366
- Fix resume checkpoint mapping for torch models only by @gitttt-1234 in #370
- Fix metrics saving format to match SLEAP 1.4 and eliminate code duplication by @gitttt-1234 in #371
- Mask wandb API key in initial_config.yaml by @gitttt-1234 in #372
- Update default trainer configuration parameters for improved training stability by @gitttt-1234 in #374
- Update default configuration values for improved training by @gitttt-1234 in #375
- Add dependency update instructions for all installation methods by @gitttt-1234 in #376
- Handle empty and "None" string values for run_name and ckpt_dir config parameters by @gitttt-1234 in #377
- Append video name to output path when video_index is specified by @gitttt-1234 in #378
- Bump version to 0.0.5 by @gitttt-1234 in #379
Full Changelog: v0.0.4...v0.0.5
SLEAP-NN v0.0.4
Summary
This release includes a dependency version bump and a critical bug fix for empty instance handling. The minimum torchvision version has been updated to 0.20.0, and sleap-io minimum version has been set to 0.5.7 to ensure compatibility with the latest features and improvements.
Major changes
Dependency Version Updates (#365)
- Minimum torchvision version: Set to 0.20.0 across all torch extras (torch, torch-cpu, torch-cuda118, torch-cuda128)
- Minimum sleap-io version: Updated to 0.5.7 for improved compatibility
Bug Fixes
- Fixed empty instance handling (#364): Improved handling of instances with only NaN keypoints in the instance cropping method and
CenteredInstanceDatasetclass. Previously, these instances would trigger "NaN values encountered" warnings when computing bounding boxes. The fix ensures only non-empty instances are processed for crop size computation and removes redundant filtering logic.
Changelog
Full Changelog: v0.0.3...v0.0.4
SLEAP-NN v0.0.3
Summary
This release delivers critical bug fixes for multiprocessing support, enhanced tracking capabilities, and significant improvements to the inference workflow. The v0.0.3 release resolves HDF5 pickling issues that prevented proper multiprocessing on macOS/Windows, fixes ID models, and introduces new track cleaning parameters for better tracking performance.
Major changes
Fixed Multiprocessing Bug with num_workers > 0 (#359)
Resolved HDF5 pickling issues that prevented proper multiprocessing on macOS/Windows systems. This fix enables users to utilize multiple workers for faster data loading during training and inference when caching is enabled.
Fixed ID Models (#345)
Fixed minor issues with TopDown and BottomUp ID models.
- The ID models dataset classes were re-computing the tracks from the labels file. However, they should just grab it from the head config classes parameter.
- Fix shape mismatch issue with BottomUp ID models
Added Track Cleaning Arguments (#349)
Added new parameters for better track management and cleanup:
- tracking_clean_instance_count: Target number of instances to clean after tracking
- tracking_clean_iou_threshold: IOU threshold for cleaning overlapping instances
- tracking_pre_cull_to_target: Pre-culling instances before tracking
- tracking_pre_cull_iou_threshold: IOU threshold for pre-culling
Updated Installation Documentation (#348, #351)
Added comprehensive uv add installation instructions for modern Python package management instead of uv pip install method. Added warning for 3.14 python version to prevent installation issues.
Inference workflow enhancements (#360, #361)
Enhanced bottom-up model inference capabilities with improved performance and stability. Fix logger encoding issues on windows and better handle integral refinement error on mps accelerator.
Changelog
- Fix ID models by @gitttt-1234 in #345
- Fix changelog.md by @gitttt-1234 in #346
- Add warning for Python v3.14 by @gitttt-1234 in #348
- Add track cleaning args by @gitttt-1234 in #349
- Update uv add installation docs by @gitttt-1234 in #351
- Fix marimo usage docs by @gitttt-1234 in #352
- Fix target instance count parameter by @gitttt-1234 in #358
- Fix multiprocessing bug with num_workers>0 by @gitttt-1234 in #359
- Minor fixes to inference workflow by @gitttt-1234 in #360
- Update bottomup inference and add note on num_workers by @gitttt-1234 in #361
- Bump version to v0.0.3 by @gitttt-1234 in #362
SLEAP-NN v0.0.2
Summary
This release focuses on several bug fixes and improvements across the training, inference, and CLI components of sleap-nn. It includes bug fixes for model backbones and loaders, enhancements to the configuration and CLI experience, improved robustness in multi-GPU training, and new options for device selection and tracking. Documentation and installation guides have also been updated, along with internal refactors to streamline the code consistency.
Major changes
-
Backbones & Models:
- Fixed bugs in Swin Transformer and UNet backbone filter computations.
- Corrected weight mapping for legacy TopDown ID models.
-
Inference & Tracking:
- Removed unintended loading of pretrained weights during inference.
- Fixed inference with suggestion frames and improved stalling handling.
- Added option to run tracking on selected frames and video indices.
- Added thread-safe video access to prevent backend crashes.
- Added function to load metrics for better evaluation reporting.
-
Training Pipeline:
- Fixed bugs in the training workflow with the infinite dataloader handling.
- Improved seeding behavior for reproducible label splits in multi-GPU setups.
- Fixed experiment run name generation across multi-GPU workers.
-
CLI & Config:
- Introduced unified sleap-nn CLI with subcommands (train, track, eval) and more robust help injection.
- Removed deprecated CLI commands and cleaned up legacy imports.
- Added option to specify which devices to use, with auto-selection of GPUs based on available memory.
- Updated sample configs and sleap-io skeleton function usage.
- Minor parameter name and default updates for consistency with SLEAP.
-
Documentation & Installation:
- Fixed broken documentation pages and improved menu structure.
- Updated installation instructions with CUDA support for uv-based workflows.
What's Changed
- Fix Bug for SwinT Backbone Model by @7174Andy in #304
- More robust help injection in CLI by @tom21100227 in #303
- Remove loading pretrained weights during inference pipeline by @gitttt-1234 in #305
- Remove
backimport in lightning module by @gitttt-1234 in #312 - Fix compute filters in unet by @gitttt-1234 in #313
- Update CLI commands by @gitttt-1234 in #314
- Update sleap-io skeleton functions usage by @gitttt-1234 in #315
- Minor updates to config parameters by @gitttt-1234 in #316
- Minor bug fixes by @gitttt-1234 in #317
- Fix Inference on SuggestionFrames by @7174Andy in #318
- Add pck to voc metrics by @gitttt-1234 in #320
- Fix bugs in training pipeline by @gitttt-1234 in #322
- Add option to specify which devices to use by @gitttt-1234 in #327
- Fix bug in infinite data loader by @gitttt-1234 in #325
- Add thread-safe video access by @gitttt-1234 in #326
- Fix bugs in docs by @gitttt-1234 in #319
- Change zmq address to port arguments by @gitttt-1234 in #328
- Add option to run tracking on select frames by @gitttt-1234 in #329
- Fix seeding in training workflow by @gitttt-1234 in #330
- Fix inference stalling by @gitttt-1234 in #331
- Make wandb artifact logging optional by @gitttt-1234 in #332
- Auto-select GPUs by @gitttt-1234 in #333
- Add function to load metrics by @gitttt-1234 in #334
- Fix experiment run name in multi-gpu training by @gitttt-1234 in #336
- Add option to pass labels and video objects by @gitttt-1234 in #337
- Fix mapping for legacy topdown id models by @gitttt-1234 in #339
- Modify uv installation docs for cuda support by @gitttt-1234 in #340
- Update sample configs by @gitttt-1234 in #338
- Bump up sleap-nn version for v0.0.2 by @gitttt-1234 in #341
Full Changelog: v0.0.1...v0.0.2
SLEAP-NN v0.0.1
SLEAP-NN v0.0.1 - Initial Release
SLEAP-NN is a PyTorch-based deep learning framework for pose estimation, built on top of the SLEAP (Social LEAP Estimates Animal Poses) platform. This framework provides efficient training, inference, and evaluation tools for multi-animal pose estimation tasks.
Documentation: https://nn.sleap.ai/
Quick start
# Install with PyTorch CPU support
pip install sleap-nn[torch-cpu]
# Train a model
sleap-nn train --config-name config.yaml --config-dir configs/
# Run inference
sleap-nn track --model_paths model.ckpt --data_path video.mp4
# Evaluate predictions
sleap-nn eval --ground_truth_path gt.slp --predicted_path pred.slp
What's Changed
- Core Data Loader Implementation by @davidasamy in #4
- Add centroid finder block by @davidasamy in #7
- Add DataBlocks for rotation and scaling by @gitttt-1234 in #8
- Refactor datapipes by @talmo in #9
- Instance Cropping by @davidasamy in #13
- Add more Kornia augmentations by @alckasoc in #12
- Confidence Map Generation by @davidasamy in #11
- Peak finding by @alckasoc in #14
- UNet Implementation by @alckasoc in #15
- Top-down Centered-instance Pipeline by @alckasoc in #16
- Adding ruff to ci.yml by @alckasoc in #21
- Implement base Model and Head classes by @alckasoc in #17
- Add option to Filter to user instances by @gitttt-1234 in #20
- Add Evaluation Module by @gitttt-1234 in #22
- Add metadata to dictionary by @gitttt-1234 in #24
- Added SingleInstanceConfmapsPipeline by @alckasoc in #23
- modify keys by @gitttt-1234 in #31
- Small fix to find_global_peaks_rough by @alckasoc in #28
- Add trainer by @gitttt-1234 in #29
- PAF Grouping by @alckasoc in #33
- Add predictor class by @gitttt-1234 in #36
- Edge Maps by @alckasoc in #38
- Add ConvNext Backbone by @gitttt-1234 in #40
- Add VideoReader by @gitttt-1234 in #45
- Refactor model pipeline by @gitttt-1234 in #51
- Add BottomUp model pipeline by @gitttt-1234 in #52
- Remove Part-names and Edge dependency in config by @gitttt-1234 in #54
- Refactor model config by @gitttt-1234 in #61
- Refactor Augmentation config by @gitttt-1234 in #67
- Add minimal pretrained checkpoints for tests and fix PAF grouping interpolation by @gqcpm in #73
- Fix augmentation in TopdownConfmaps pipeline by @gitttt-1234 in #86
- Implement tracker module by @gitttt-1234 in #87
- Resume training and automatically compute crop size for TopDownConfmaps pipeline by @gitttt-1234 in #88
- LitData Refactor PR1: Get individual functions for data pipelines by @gitttt-1234 in #90
- Add function to load trained weights for backbone model by @gitttt-1234 in #95
- Remove IterDataPipe from Inference pipeline by @gitttt-1234 in #96
- Move ld.optimize to a subprocess by @gitttt-1234 in #100
- Auto compute max height and width from labels by @gitttt-1234 in #101
- Fix sizematcher in Inference data pipline by @gitttt-1234 in #102
- Convert Tensor images to PIL by @gitttt-1234 in #105
- Add threshold mode in config for learning rate scheduler by @gitttt-1234 in #106
- Add option to specify
.binfile directory in config by @gitttt-1234 in #107 - Add StepLR scheduler by @gitttt-1234 in #109
- Add config to WandB by @gitttt-1234 in #113
- Add option to load trained weights for Head layers by @gitttt-1234 in #114
- Add option to load ckpts for backbone and head for running inference by @gitttt-1234 in #115
- Add option to reuse
.binfiles by @gitttt-1234 in #116 - Fix Normalization order in data pipelines by @gitttt-1234 in #118
- Add torch Dataset classes by @gitttt-1234 in #120
- Fix Pafs shape by @gitttt-1234 in #121
- Add caching to Torch Datasets pipeline by @gitttt-1234 in #123
- Remove
random_cropaugmentation by @gitttt-1234 in #124 - Generate np chunks for caching by @gitttt-1234 in #125
- Add
groupto wandb config by @gitttt-1234 in #126 - Fix crop size by @gitttt-1234 in #127
- Resize images before cropping in Centered-instance model by @gitttt-1234 in #129
- Check memory before caching by @gitttt-1234 in #130
- Replace
evalwith an explicit mapping dictionary by @gitttt-1234 in #131 - Add
CyclerDataLoaderto ensure minimum steps per epoch by @gitttt-1234 in #132 - Fix running inference on Bottom-up models with CUDA by @gitttt-1234 in #133
- Fix caching in datasets by @gitttt-1234 in #134
- Save
.slpfile after inference by @gitttt-1234 in #135 - Add option to reuse np chunks by @gitttt-1234 in #136
- Filter instances while generating indices by @gitttt-1234 in #138
- Fix config format while logging to wandb by @gitttt-1234 in #144
- Add multi-gpu support by @gitttt-1234 in #145
- Implement Omegaconfig PR1: basic functionality by @gqcpm in #97
- Move all params to config by @gitttt-1234 in #146
- Add output stride to backbone config by @gitttt-1234 in #147
- Change backbone config structure by @gitttt-1234 in #149
- Add an entry point train function by @gitttt-1234 in #150
- Add logger by @gqcpm in #148
- Fix preprocessing during inference by @gitttt-1234 in #156
- Add CLI for training by @gitttt-1234 in #155
- Specify custom anchor index in Inference pipeline by @gitttt-1234 in #157
- Fix lr scheduler config by @gitttt-1234 in #158
- Add max stride to Convnext and Swint backbones by @gitttt-1234 in #159
- Fix length in custom datasets by @gitttt-1234 in #160
- Add
scaleargument to custom datasets by @gitttt-1234 in #166 - Fix size matcher by @gitttt-1234 in #167
- Fix max instances in TopDown Inference by @gitttt-1234 in #168
- Move lightning modules by @gitttt-1234 in #169
- Save config with chunks by @gitttt-1234 in #174
- Add profiler and strategy parameters by @gitttt-1234 in #175
- Add docker img for remote dev by @gitttt-1234 in #176
- Save files only in rank: 0 by @gitttt-1234 in #177
- Minor changes to validate configs by @gitttt-1234 in #179
- Fix multi-gpu training by @gitttt-1234 in #184
- Cache only images by @gitttt-1234 in #186
- Add a new data pipeline strategy without caching by @gitttt-1234 in #187
- Minor fixes to lightning modules by @gitttt-1234 in #189
- Fix caching when imgs path already exist by @gitttt-1234 in #191
- Ensure caching of images to...