Skip to content

CLI Reference

This page provides the full reference of the chirpdetector command line interface.

Instead of using chirpdetector COMMAND, all commands documented here can also be invoked with the much briefer cpd COMMAND.

chirpdetector

Welcome to Chirpdetector Version: 0.0.1 🐟⚡

The chirpdetector command line tool is a collection of commands that make it easier to detect chirps of wave-type weakly electric fish on a spectrogram. The usual workflow is:

1. `copyconfig` to copy the configfile to your dataset.
2. `convert` to convert your dataset to training data.
3. label your data, e.g. in label-studio.
4. `train` to train the detector.
5. `detect` to detect chirps on your dataset.
6. `assign` to assign detections to the tracks of individual fish.

Repeat this cycle from (2) to (5) until you are satisfied with the
detection performance.

For more information including a tutorial, see the documentation at
*https://weygoldt.com/chirpdetector*

Usage:

chirpdetector [OPTIONS] COMMAND [ARGS]...

Options:

  -V, --version  Show the version and exit.
  --help         Show this message and exit.

assign

Detect chirps on a spectrogram.

Usage:

chirpdetector assign [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  --help                Show this message and exit.

convert

Convert a wavetracker dataset to YOLO.

Convert wavetracker dataset to labeled or unlabeled spectrogram images to train the model.

Usage:

chirpdetector convert [OPTIONS]

Options:

  -i, --input_path DIRECTORY      Path to the input dataset.  [required]
  -o, --output_path DIRECTORY     Path to the output dataset.  [required]
  -l, --labels [none|synthetic|detected]
                                  Whether labels are not there yet (none),
                                  simulated (synthetic) or inferred by the
                                  detector (detected).  [required]
  --help                          Show this message and exit.

copyconfig

Copy the default config file to your dataset.

Usage:

chirpdetector copyconfig [OPTIONS]

Options:

  -i, --input_path DIRECTORY  Path to the dataset.  [required]
  --help                      Show this message and exit.

datautils

Utilities to manage YOLO-style training datasets.

Usage:

chirpdetector datautils [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

clean

Remove all images where the label file is empty.

Usage:

chirpdetector datautils clean [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  -e, --img_ext TEXT    The image extension, e.g. .png or .jpg  [required]
  --help                Show this message and exit.

merge

Merge two datasets.

Usage:

chirpdetector datautils merge [OPTIONS]

Options:

  -d1, --dataset1 DIRECTORY  Path to the first dataset.  [required]
  -d2, --dataset2 DIRECTORY  Path to the second dataset.  [required]
  -o, --output DIRECTORY     Path to the output dataset.  [required]
  --help                     Show this message and exit.

subset

Create a subset of a dataset.

Useful for manually labeling a small subset.

Usage:

chirpdetector datautils subset [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  -e, --img_ext TEXT    The image extension, e.g. .png or .jpg  [required]
  -n, --n INTEGER       The size of the subset  [required]
  --help                Show this message and exit.

detect

Detect chirps on a spectrogram.

Usage:

chirpdetector detect [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  --help                Show this message and exit.

evaltrain

Detect chirps on a spectrogram.

Usage:

chirpdetector evaltrain [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  --help                Show this message and exit.

plot

Plot detected chirps on a spectrogram.

You can supply a path to a single recording and plot all chirp detections for it or delete all plots if you supply the --clean option.

Alternatively, you can supply a path to a folder containing multiple recordings and plot all chirp detections for all recordings if you supply the --all option. You can also delete all plots for all recordings if you supply the --all and --clean options.

Usage:

chirpdetector plot [OPTIONS]

Options:

  -p, --path DIRECTORY  Path to the dataset.  [required]
  -a, --all             Whether to iterate over multiple datasets.
  -c, --clean           Just delete plots in the current dataset.
  --help                Show this message and exit.

train

Train the model.

Usage:

chirpdetector train [OPTIONS]

Options:

  -c, --config_path FILE          Path to the configuration file.  [required]
  -m, --mode [pretrain|finetune]  Whether to train the model with synthetic
                                  data or to finetune a model with real data.
                                  [required]
  --help                          Show this message and exit.