Skip to content

Commit 4ca6334

Browse files
authored
Update docs on new CLIs (#2397)
1 parent d0ce6d3 commit 4ca6334

File tree

7 files changed

+101
-10
lines changed

7 files changed

+101
-10
lines changed

docs/guides/guides-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
!!! warning "Documentation for New SLEAP Versions"
55
This documentation is for the **latest version of SLEAP**.
6-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
6+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
77

88
!!! info "Major Changes in SLEAP 1.5+"
99
Want to learn about the major changes and updates in the latest release?
@@ -21,5 +21,5 @@
2121

2222
!!! note "Bonsai Integration"
2323
**Bonsai is not natively supported with the new Torch backend in SLEAP.**
24-
If you want to use Bonsai with legacy SLEAP models, please refer to the [legacy Bonsai guide](http://legacy.sleap.ai/guides/bonsai.html).
24+
If you want to use Bonsai with legacy SLEAP models, please refer to the [legacy Bonsai guide](https://legacy.sleap.ai/guides/bonsai.html).
2525

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SLEAP is an open-source deep-learning based framework for multi-animal pose trac
66

77
!!! warning "Documentation for New SLEAP Versions"
88
This documentation is for the **latest version of SLEAP**.
9-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
9+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
1010

1111

1212
!!! tip "New in SLEAP 1.5"

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!!! warning "Documentation for New SLEAP Versions"
44
This documentation is for the **latest version of SLEAP**.
5-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
5+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
66

77
SLEAP can be installed as a Python package on Windows, Linux, and Mac OS. The newest version of SLEAP can always be found in the [Releases page](https://github.com/talmolab/sleap/releases).
88

docs/notebooks/notebooks-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Here are Jupyter notebooks you can run to try SLEAP on [Google Colaboratory](htt
44

55
!!! warning "Documentation for New SLEAP Versions"
66
This documentation is for the **latest version of SLEAP**.
7-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
7+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
88

99
## Basic usage
1010

docs/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In a nutshell, SLEAP allows you to train and use deep learning-based models that
66

77
!!! warning "Documentation for New SLEAP Versions"
88
This documentation is for the **latest version of SLEAP**.
9-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
9+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
1010

1111
Below is a high-level overview of a typical end-to-end workflow in SLEAP. You can also step through this workflow yourself in the [Tutorial](tutorial/overview.md) section.
1212

docs/reference/command-line-interfaces.md

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ optional arguments:
3131
### `sleap-train`
3232

3333
!!! note
34-
`sleap-train` is the legacy CLI for training and internally invokes the `sleap-nn` training workflow. **We recommend using [`sleap-nn train`](https://nn.sleap.ai/latest/training/#using-cli) directly for new projects.** You do **not** need to install the full SLEAP package to use the training CLI—having just `sleap-nn` is sufficient. If SLEAP was installed or built with the neural network (nn) dependencies, then `sleap-nn train` would still work.
34+
`sleap-train` is the legacy CLI for training and internally invokes the `sleap-nn` training workflow. **We recommend using [`sleap-nn-train`](#sleap-nn-train) or [`sleap-nn train`](https://nn.sleap.ai/latest/training/#using-cli) directly for new projects.** You do **not** need to install the full SLEAP package to use `sleap-nn train`—having just `sleap-nn` is sufficient. If SLEAP was installed or built with the neural network (nn) dependencies, then `sleap-nn-train` would work.
3535

3636
`sleap-train` is the command-line interface for training. Use this for training on a remote machine/cluster/colab notebook instead of through the GUI.
3737

@@ -88,17 +88,50 @@ optional arguments:
8888
8989
```
9090

91+
### `sleap-nn-train`
92+
93+
!!! note
94+
`sleap-nn-train` is similar to `sleap-nn train` but is only accessible when SLEAP is installed. To use `sleap-nn train` directly, you can install just the `sleap-nn` package without the full SLEAP installation. For detailed information about `sleap-nn train`, see the [sleap-nn training documentation](https://nn.sleap.ai/latest/training/#using-cli). The functionality works the same way—both commands use Hydra configuration files and support the same training options and parameters.
95+
96+
`sleap-nn-train` is the command-line interface for training neural network models using the PyTorch backend. This command provides the same functionality as `sleap-nn train` but is available when you have the full SLEAP installation.
97+
98+
**Usage:**
99+
```bash
100+
sleap-nn-train --config-name <config_name> --config-dir <config_directory> [overrides]
101+
```
102+
103+
**Examples:**
104+
```bash
105+
# Start a new training run
106+
sleap-nn-train --config-name baseline --config-dir /path/to/config/
107+
108+
# with shortcuts
109+
sleap-nn-train -c baseline -d /path/to/config/
110+
111+
# Override any config parameters
112+
sleap-nn-train --config-name baseline --config-dir /path/to/config/ \
113+
trainer_config.max_epochs=100
114+
115+
# Resume training with additional epochs
116+
sleap-nn-train --config-name baseline --config-dir /path/to/config/ \
117+
trainer_config.resume_ckpt_path=/path/to/checkpoint.ckpt \
118+
trainer_config.max_epochs=20
119+
```
120+
121+
For more detailed information about training configurations, model architectures, and advanced options, refer to the [sleap-nn training documentation](https://nn.sleap.ai/latest/training/#using-cli).
122+
91123
!!! warning
92124
The `sleap-export` command is **not currently supported** in the latest versions of SLEAP, as we have transitioned to a PyTorch backend (`sleap-nn`). For more information about the new backend, see the [sleap-nn documentation](https://nn.sleap.ai).
93125

94-
`sleap-export` is still available in SLEAP versions **1.4.1 and earlier**. Please refer to the [legacy SLEAP documentation](http://legacy.sleap.ai/guides/cli.html#sleap-export) for details on using this command in older versions.
126+
`sleap-export` is still available in SLEAP versions **1.4.1 and earlier**. Please refer to the [legacy SLEAP documentation](https://legacy.sleap.ai/guides/cli.html#sleap-export) for details on using this command in older versions.
127+
95128

96129
## Inference and Tracking
97130

98131
### `sleap-track`
99132

100133
!!! note
101-
`sleap-track` is the legacy CLI for training and internally invokes the `sleap-nn` inference workflow. **We recommend using [`sleap-nn track`](https://nn.sleap.ai/latest/inference/#run-inference-with-cli) directly for new projects.** You do **not** need to install the full SLEAP package to use the training CLI—having just `sleap-nn` is sufficient. If SLEAP was installed or built with the neural network (nn) dependencies, then `sleap-nn track` would still work.
134+
`sleap-track` is the legacy CLI for training and internally invokes the `sleap-nn` training workflow. **We recommend using [`sleap-nn-track`](#sleap-nn-track) or [`sleap-nn track`](https://nn.sleap.ai/latest/inference/#run-inference-with-cli) directly for new projects.** You do **not** need to install the full SLEAP package to use `sleap-nn track`—having just `sleap-nn` is sufficient. If SLEAP was installed or built with the neural network (nn) dependencies, then `sleap-nn-track` would work.
102135

103136
`sleap-track` is the command-line interface for running inference using models which have already been trained. Use this for running inference on a remote machine such as an HPC cluster or Google Colab notebook.
104137

@@ -245,6 +278,64 @@ sleap-track --gpu 1 ...
245278
```none
246279
sleap-track -m "models/my_model" --frames 1000-2000 "input_video.mp4"
247280
```
281+
282+
283+
### `sleap-nn-track`
284+
285+
!!! note
286+
`sleap-nn-track` is similar to `sleap-nn track` but is only accessible when SLEAP is installed. To use `sleap-nn track` directly, you can install just the `sleap-nn` package without the full SLEAP installation. For detailed information about `sleap-nn track`, see the [sleap-nn inference documentation](https://nn.sleap.ai/latest/inference/#run-inference-with-cli). The functionality works the same way—both commands use the same parameters.
287+
288+
`sleap-nn-track` is the command-line interface for running inference and tracking using models which have already been trained using the PyTorch backend. This command provides the same functionality as `sleap-nn track` but is available when you have the full SLEAP installation.
289+
290+
**Usage:**
291+
```bash
292+
sleap-nn-track --data_path <input_path> --model_paths <model_directory> [options]
293+
```
294+
295+
**Examples:**
296+
```bash
297+
# Basic inference on a video
298+
sleap-nn-track -i video.mp4 -m models/ckpt_folder/
299+
300+
# Run inference on a specific CUDA device
301+
sleap-nn-track --data_path video.mp4 --model_paths models/ckpt_folder/ --device cuda:0
302+
303+
# Run inference on specific frames
304+
sleap-nn-track --data_path video.mp4 --frames "0-100,200-300" --model_paths models/ckpt_folder/
305+
306+
# Run inference with tracking enabled
307+
sleap-nn-track --data_path video.mp4 --model_paths models/ckpt_folder/ --tracking
308+
309+
# Two-stage model inference (topdown models)
310+
sleap-nn-track --data_path video.mp4 \
311+
--model_paths models/centroid_unet/ \
312+
--model_paths models/centered_instance_unet/
313+
314+
# Track-only workflow on existing labels
315+
sleap-nn-track --data_path labels.slp --tracking
316+
```
317+
318+
**Key Parameters:**
319+
320+
- `--data_path / -i`: Path to video file or .slp labels file
321+
- `--model_paths / -m`: Path to model directory containing best.ckpt and training_config.yaml
322+
- `--output_path / -o`: Output filename (defaults to [data_path].predictions.slp)
323+
- `--device / -d`: Device to use ('cpu', 'cuda', 'mps', 'auto')
324+
- `--batch_size / -b`: Number of frames to process at once (default: 4)
325+
- `--tracking / -t`: Enable tracking on predicted instances
326+
- `--frames`: Specific frames to process (e.g., "0-100,200-300")
327+
- `--peak_threshold`: Minimum confidence for peak detection (default: 0.2)
328+
329+
**Tracking Options:**
330+
331+
- `--tracking_window_size`: Number of frames for candidate matching (default: 5)
332+
- `--candidates_method`: Either 'fixed_window' or 'local_queues' (default: fixed_window)
333+
- `--features`: Feature representation for matching ('keypoints', 'centroids', 'bboxes', 'image')
334+
- `--scoring_method`: Association scoring method ('oks', 'cosine_sim', 'iou', 'euclidean_dist')
335+
- `--use_flow`: Enable optical flow-based tracking
336+
337+
For more detailed information about all available parameters, tracking methods, and advanced options, refer to the [sleap-nn inference documentation](https://nn.sleap.ai/latest/inference/#run-inference-with-cli).
338+
248339
## Dataset files
249340

250341
### `sleap-convert`

docs/tutorial/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ hide:
77

88
!!! warning "Documentation for New SLEAP Versions"
99
This documentation is for the **latest version of SLEAP**.
10-
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](http://legacy.sleap.ai).
10+
If you are using **SLEAP version 1.4.1 or earlier**, please visit the [legacy documentation](https://legacy.sleap.ai).
1111

1212
The tutorial will walk you through the entire SLEAP workflow. You can follow along this tutorial and try running SLEAP on one of our [sample datasets](../reference/datasets.md). Then you will be ready to start using SLEAP on your own data.
1313

0 commit comments

Comments
 (0)