Commit be15732
Add progress bar to tracker (#366)
## Summary
- Add rich progress bar to `run_tracker` function in
`sleap_nn/tracking/tracker.py`
- Implements custom `RateColumn` showing frames/sec processing speed
- Follows the same implementation pattern as `inference/predictors.py`
for consistency
- Add logging statements for post-processing steps (culling and
connecting single breaks)
- Add `scratch/` folder to `.gitignore` for development notes
## Changes
### Files Modified:
1. **`.gitignore`** - Add `scratch/` folder
2. **`sleap_nn/tracking/tracker.py`**:
- Add rich imports (`Progress`, `BarColumn`, `TimeElapsedColumn`,
`TimeRemainingColumn`, `MofNCompleteColumn`)
- Add `RateColumn` class to display frames/sec processing rate
- Wrap main tracking loop with Progress context manager
- Add manual refresh throttling (0.25s) for optimal performance
- Add `KeyboardInterrupt` handling for graceful cancellation
- Add logging for post-processing steps
### Progress Bar Configuration:
- Shows percentage complete, M of N frames, ETA, elapsed time, and
frames/sec
- Manual refresh control (`auto_refresh=False`) with 0.25s throttle
- Speed estimation window of 5 seconds
- Matches configuration from `predictors.py` for consistency
## Cross-Platform Compatibility
- Uses rich library (already in dependencies)
- No platform-specific code
- Tested and works on Windows, Linux, and macOS
## Test Plan
- [x] Run tracking-specific tests: `pytest
tests/tracking/test_tracker.py` - **All 8 tests passed**
- [x] Run full test suite: `pytest tests/` - **All 248 tests passed** (4
skipped, 3 xfailed)
- [x] Verify no functional changes to tracking behavior
- [x] Confirm progress bar displays correctly during tracking
## Screenshots
_Progress bar will display during tracking operations showing real-time
progress with frames/sec rate_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent 484bbc2 commit be15732
File tree
4 files changed
+93
-28
lines changed- .claude/commands
- sleap_nn/tracking
4 files changed
+93
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| |||
716 | 724 | | |
717 | 725 | | |
718 | 726 | | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
719 | 738 | | |
720 | 739 | | |
721 | 740 | | |
| |||
810 | 829 | | |
811 | 830 | | |
812 | 831 | | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | 832 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
836 | 884 | | |
837 | 885 | | |
| 886 | + | |
838 | 887 | | |
839 | 888 | | |
840 | 889 | | |
841 | 890 | | |
| 891 | + | |
842 | 892 | | |
843 | 893 | | |
844 | 894 | | |
| |||
0 commit comments