LuxonisML
🌟 Overview
LuxonisML is the core library of the Luxonis MLOps stack. It defines the
Luxonis Data Format (LDF), and it provides the dataset, loader, parser,
tracking, and utility layers that the other Luxonis tools build on.
LuxonisTrain,
ModelConverter, and
LuxonisEval all depend on it.
✨ Key Features
- One Dataset Format: Build a computer vision dataset once, then train on it with any of the Luxonis tools.
- Bring Your Own Data: Convert
COCO,YOLO,VOC,RoboFlow, and other common formats with a single call. - Storage Agnostic: Keep the images locally, in
Google Cloud Storage, or inS3, without a change to your training code. - Rich Annotations: Bounding boxes, keypoints, semantic and instance segmentation, classification, arrays, and free-form metadata.
- One Tracking API: Log metrics to
TensorBoard,Weights & Biases, orMLflowthrough one interface.
[!WARNING] The project is in a beta state and might be unstable or contain bugs - please report any feedback.
🚀 Quick Start
-
Install
LuxonisMLpip install luxonis-ml[data]
This will create the
luxonis_mlexecutable in yourPATH. -
Convert a dataset into LDF
We will use a sample COCO dataset from
RoboFlowin this example.luxonis_ml data parse "roboflow://team-roboflow/coco-128/2/coco" --name coco_test
[!IMPORTANT] A
roboflow://source needs theROBOFLOW_API_KEYenvironment variable. Get your key from the Roboflow settings. The Roboflow documentation gives the steps. -
Inspect the result
luxonis_ml data info coco_test luxonis_ml data inspect coco_test
-
Load it in your training code
from luxonis_ml.data import LuxonisDataset, LuxonisLoader loader = LuxonisLoader(LuxonisDataset("coco_test"), view="train") for sample in loader: images = sample.images labels = sample.labels
[!NOTE] For hands-on examples of how to prepare data with
LuxonisMLand train AI models usingLuxonisTrain, check out this guide.
📜 Table Of Contents
- 🌟 Overview
- 🚀 Quick Start
- 🧩 Modules
- 🛠️ Installation
- 📝 Usage
- 💻 CLI
- 🔑 Credentials
- 📚 Documentation
- 🤝 Contributing
🧩 Modules
Each module links to its own API reference:
| Module | Extra | Purpose |
|---|---|---|
luxonis_ml.data |
data |
Dataset creation, conversion, loading, augmentation, and export. |
luxonis_ml.ldf |
ldf |
The annotation schemas of the Luxonis Data Format. A subset of data. |
luxonis_ml.tracker |
tracker |
One experiment tracking API for TensorBoard, Weights & Biases, and MLflow. |
luxonis_ml.telemetry |
telemetry |
A lightweight telemetry client with pluggable backends. |
luxonis_ml.nn_archive |
nn_archive |
NN Archive creation and inspection. |
luxonis_ml.utils |
utils |
Config, environment, filesystem, logging, graph, and registry helpers. |
🛠️ Installation
LuxonisML requires Python 3.10 or higher. We recommend using a virtual
environment to manage dependencies.
Install via pip:
pip install luxonis-ml[data]
Each module has its own extra, so you install only what you use:
| Extra | Installs the dependencies of |
|---|---|
ldf |
luxonis_ml.ldf |
data |
luxonis_ml.data, and luxonis_ml.ldf with it |
tracker |
luxonis_ml.tracker, except mlflow and opencv-python |
telemetry |
luxonis_ml.telemetry, with the PostHog backend |
nn_archive |
luxonis_ml.nn_archive |
utils |
luxonis_ml.utils |
all |
All of the above, and all of the extras below |
The data, ldf, tracker, and utils modules fail on import when you do
not install their extra. The message names the extra. luxonis_ml.telemetry
is an exception: it imports without posthog and falls back to a no-op
backend.
☁️ Additional Dependencies
These extras add support for specific cloud services and integrations:
| Extra | Adds support for |
|---|---|
gcs |
Google Cloud Storage |
s3 |
AWS S3 |
roboflow |
Dataset downloads from Roboflow |
mlflow |
MLflow tracking and artifact storage |
[!NOTE]
LuxonisMLinstalls these four dependencies for you on first use. If you open ags://,gcs://,s3://,mlflow://, orroboflow://path and the package is absent,LuxonisMLinstalls it and continues. Install the extra yourself when you want a reproducible environment or an offline machine.
Examples:
# the data module, with Google Cloud Storage and Roboflow support
pip install luxonis-ml[data,gcs,roboflow]
# everything
pip install luxonis-ml[all]
For a development environment, read CONTRIBUTING.md. The
development tooling lives in uv dependency groups, not in a published extra.
📝 Usage
💾 Creating a Dataset
A dataset is a named collection of records. Each record points to one image and carries one annotation. The coordinates are relative to the image size.
from luxonis_ml.data import LuxonisDataset
dataset = LuxonisDataset("parking_lot")
def records():
yield {
"file": "images/frame_001.jpg",
"task_name": "detection",
"annotation": {
"class": "car",
"boundingbox": {
"x": 0.1,
"y": 0.2,
"w": 0.3,
"h": 0.4,
},
},
}
dataset.add(records())
dataset.make_splits({"train": 0.8, "val": 0.1, "test": 0.1})
LDF also supports keypoints, semantic and instance segmentation,
classification, arrays, and free-form metadata. See
luxonis_ml.data.datasets
for the dataset contract, and the luxonis_ml.ldf module for every annotation
schema.
🔄 Converting an Existing Dataset
LuxonisParser reads the common dataset formats. It detects the format from
the directory structure when you do not name one.
from luxonis_ml.data import LuxonisParser
dataset = LuxonisParser(
"path/to/coco_dataset",
dataset_name="coco",
).parse()
The dataset path can be one of the following:
- a local directory, or a
ZIParchive s3://bucket/path/to/directoryfor AWS S3gs://bucket/path/to/directoryorgcs://bucket/path/to/directoryfor Google Cloud Storageroboflow://{workspace}/{project}/{version}/{format}for RoboFlowultralytics://{username}/datasets/{slug}for Ultralytics
See
luxonis_ml.data.parsers
for the supported formats and their expected layouts.
📤 Loading the Data
LuxonisLoader reads one or more splits. It resizes the images, applies the
augmentations, and returns the labels for each task.
from luxonis_ml.data import LuxonisLoader
loader = LuxonisLoader(dataset, view="train", height=640, width=640)
for sample in loader:
images = sample.images
labels = sample.labels
Labels use "task_name/task_type" keys, such as "detection/boundingbox". See
luxonis_ml.data.loaders
for the output shapes, and
luxonis_ml.data.augmentations
for the augmentation configuration.
📈 Tracking an Experiment
from luxonis_ml.tracker import LuxonisTracker
tracker = LuxonisTracker(
project_name="parking_lot",
run_name="baseline",
is_tensorboard=True,
)
tracker.log_metric("loss", 0.42, step=1)
tracker.close()
[!NOTE] The
trackerextra does not install every dependency ofluxonis_ml.tracker. The module importsmlflowandcv2at import time, so installmlflowandopencv-pythonas well:pip install "luxonis-ml[tracker,mlflow]" opencv-python. Installtorchfor TensorBoard andwandbfor Weights & Biases.
💻 CLI
The package installs the luxonis_ml executable.
Available commands:
data- Parse, inspect, export, merge, push, pull, and delete datasetsarchive- Inspect and extractNN Archivefilesfs- Copy and list files across the supported storage backendscheckhealth- Report whether theldf,data,utils, andnn_archivemodules import correctly
To get help on any command:
luxonis_ml <command> --help
Examples:
luxonis_ml data parse ./coco_dataset --name coco
luxonis_ml data ls
luxonis_ml data health coco
luxonis_ml data export coco --type ultralyticsndjson
🔑 Credentials
When using cloud services, avoid hard-coding credentials or placing them directly in your configuration files. Instead:
- Use environment variables to store sensitive information.
- Use a
.envfile and load it securely, ensuring it's excluded from version control.
Supported Cloud Services:
- AWS S3, requires:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_S3_ENDPOINT_URL
- Google Cloud Storage, requires:
GOOGLE_APPLICATION_CREDENTIALS
- RoboFlow, requires:
ROBOFLOW_API_KEY
- Ultralytics, requires:
ULTRALYTICS_API_KEY
For logging and tracking, we support:
- MLFlow, requires:
MLFLOW_S3_BUCKETMLFLOW_S3_ENDPOINT_URLMLFLOW_TRACKING_URI
Dataset storage is configured with:
LUXONISML_BASE_PATH- local base path for datasets and cache files,~/luxonis_mlby defaultLUXONISML_TEAM_ID- team identifier used by dataset storage,offlineby defaultLUXONISML_BUCKET- the cloud bucket that holds remote datasets
[!NOTE]
LuxonisMLsends no telemetry. It only provides a telemetry client that other Luxonis packages can use. To turn that client off, setLUXONIS_TELEMETRY_ENABLED=false. See theluxonis_ml.telemetrydocumentation for the data an event carries.
📚 Documentation
The API documentation is generated from the docstrings in the source code, and it is published on the Luxonis documentation portal:
To build the documentation locally, run:
uv run pydoctor luxonis_ml
The command writes the site to apidocs/index.html.
🤝 Contributing
We welcome contributions! Please read our Contribution Guide to get started. Whether it's reporting bugs, improving documentation, or adding new features, your help is appreciated.
📄 License
This project is licensed under the Apache 2.0 License.
Metadata
Release files for luxonis-ml 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| luxonis_ml-0.10.0.tar.gz | 285.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| luxonis_ml-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 640.1 kB
Release files / luxonis_ml-0.10.0.tar.gz
| Download URL | luxonis_ml-0.10.0.tar.gz |
|---|---|
| Size | 285.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72dd2f070fabf106d658b0640536ea1486fdf9f3858d3515a793834c6d584447
|
|
BLAKE2b-256 checksum How to use checksums |
dba6157620680c37193f20f5e6d0891928dc84c574e89cfc9c676fa541cfd745
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / luxonis_ml-0.10.0-py3-none-any.whl
| Download URL | luxonis_ml-0.10.0-py3-none-any.whl |
|---|---|
| Size | 354.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8711d4de1929a67847a1f34f55414bd174facee586ce4e6212674957760f3e2c
|
|
BLAKE2b-256 checksum How to use checksums |
d1f877ff2cbbb2c6c718494e7ebc0ea90bb9b7d913496c4f925359ed3aad4ad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|