# LuxonisTrain

[LuxonisTrain](https://github.com/luxonis/luxonis-train) trains computer vision models using a YAML configuration or the Python
API. Built on PyTorch Lightning, it supports dataset inspection, training, evaluation, inference, annotation, ONNX export, and
conversion for Luxonis devices.

## Get Started

Install LuxonisTrain in a virtual environment with Python 3.10, 3.11, or 3.12:

```bash
python -m pip install luxonis-train
```

List the packaged models and inspect a model's architecture:

```bash
luxonis_train list-models
luxonis_train info --model detection --variant light
```

Train the packaged detection model on an existing LuxonisDataset:

```bash
luxonis_train train \
  --model detection --variant light \
  loader.params.dataset_name "my_dataset"
```

The packaged configuration includes the architecture and training settings. Use `key value` overrides to adjust it, or pass your
own YAML file with `--config config.yaml`. See [Data
Preparation](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/data-preparation.md) to prepare
a dataset.

Use `luxonis_train --help` to list commands and `luxonis_train <command> --help` for command options.

### Concepts

Select a packaged model, define a model graph, and register custom components.

[Configure Your Model](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/concepts.md)

### Data Preparation

Parse a dataset, select dataset splits, and inspect labels and augmentations.

[Prepare Data](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/data-preparation.md)

### Training

Configure training, resume checkpoints, track results, and tune hyperparameters.

[Train Your Model](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/training.md)

### Evaluation

Measure performance, visualize predictions, and create datasets from predicted annotations.

[Evaluate Performance](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/evaluation.md)

### Exporting

Export ONNX models, create NN Archives, convert for a target platform, and run AIMET quantization.

[Export Models](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-train/exporting.md)
