Skip to content

luxonis/tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tools-CLI

Note

This is the latest version of tools CLI. If you are looking for the tools web application, please refer to the web-app branch.

This is a command-line tool that simplifies the conversion process of YOLO models. It supports the conversion of YOLOs ranging from V5 through V11 and Gold Yolo including oriented bounding boxes object detection (OBB), pose estimation, and instance segmentation variants of YOLOv8 and YOLO11 to ONNX format and archiving them in the NN Archive format.

Warning

Please note that for the moment, we support conversion of YOLOv9 weights only from Ultralytics.

๐Ÿ“œ Table of contents

๐Ÿ’ป How to run

You can either export a model stored on the cloud (e.g. S3) or locally. You can choose to install the toolkit through pip or using Docker. In the sections below, we'll describe both options.

Prerequisites

# Cloning the tools repository and all submodules
git clone --recursive https://github.com/luxonis/tools.git
# Change folder
cd tools

Using Python package

# Install the package
pip install .
# Running the package
tools yolov6nr4.pt --imgsz "416"

Using Docker or Docker Compose

This option requires you to have Docker installed on your device. Additionally, to export a local model, please put it inside a shared-component/models/ folder in the root folder of the project.

Using Docker

# Building Docker image
docker build -t tools_cli .
# Running the image
docker run -v "${PWD}/shared_with_container:/app/shared_with_container" tools_cli shared_with_container/models/yolov8n-seg.pt --imgsz "416"

Using Docker compose

# Building Docker image
docker compose build
# Running the image
docker compose run tools_cli shared_with_container/models/yolov6nr4.pt

The output files are going to be in shared-component/output folder.

โš™๏ธ Arguments


 Usage: tools [OPTIONS] MODEL

โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    model      TEXT  Path to the model file.                                                                                                                               โ”‚
โ”‚                       [default: None]                                                                                                                                       โ”‚
โ”‚                       [required]                                                                                                                                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --imgsz                                 TEXT       Input image size in width height string format or size format where 'size' will be used for both width and height.       โ”‚
โ”‚                                                    [default: 416 416]                                                                                                       โ”‚
โ”‚ --version                               TEXT       YOLO version (e.g. "yolov8"). If None, the toolkit will run an automatic version detector.                               โ”‚
โ”‚                                                    [default: None]                                                                                                          โ”‚
โ”‚ --encoding                              [RGB|BGR]  Color encoding used in the input model. Must be RGB or BGR.                                                              โ”‚
โ”‚                                                    [default: RGB]                                                                                                           โ”‚
โ”‚ --use-rvc2             --no-use-rvc2               Whether the target platform is RVC2 or RVC3.                                                                             โ”‚
โ”‚                                                    [default: use-rvc2]                                                                                                      โ”‚
โ”‚ --class-names                           TEXT       A list of class names the model is capable of recognizing (e.g. "person, bicycle, car").                                 โ”‚
โ”‚                                                    [default: None]                                                                                                          โ”‚
โ”‚ --output-remote-url                     TEXT       An URL to upload the output to.                                                                                          โ”‚
โ”‚                                                    [default: None]                                                                                                          โ”‚
โ”‚ --put-file-plugin                       TEXT       The name of a registered function under the PUT_FILE_REGISTRY.                                                           โ”‚
โ”‚                                                    [default: None]                                                                                                          โ”‚
โ”‚ --help                                             Show this message and exit.                                                                                              โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿงฐ Supported models

Currently, the following models are supported:

Model Version Supported versions
yolov5 YOLOv5n, YOLOv5s, YOLOv5m, YOLOv5l, YOLOv5x, YOLOv5n6, YOLOv5s6, YOLOv5m6, YOLOv5l6
yolov6r1 v1.0 release: YOLOv6n, YOLOv6t, YOLOv6s
yolov6r3 v2.0 release: YOLOv6n, YOLOv6t, YOLOv6s, YOLOv6m, YOLOv6l
v2.1 release: YOLOv6n, YOLOv6s, YOLOv6m, YOLOv6l
v3.0 release: YOLOv6n, YOLOv6s, YOLOv6m, YOLOv6l
yolov6r4 v4.0 release: YOLOv6n, YOLOv6s, YOLOv6m, YOLOv6l
yolov7 YOLOv7-tiny, YOLOv7, YOLOv7x
yolov8 Detection: YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, YOLOv8x, YOLOv3-tinyu, YOLOv5nu, YOLOv5n6u, YOLOv5s6u, YOLOv5su, YOLOv5m6u, YOLOv5mu, YOLOv5l6u, YOLOv5lu
Instance Segmentation, Pose, Oriented Detection, Classification: YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, YOLOv8x
yolov9 YOLOv9t, YOLOv9s, YOLOv9m, YOLOv9c
yolov10 YOLOv10n, YOLOv10s, YOLOv10m, YOLOv10b, YOLOv10l, YOLOv10x
yolov11 Detection, Instance Segmentation, Pose, Oriented Detection, Classification: YOLO11n, YOLO11s, YOLO11m, YOLO11l, YOLO11x
goldyolo Gold-YOLO-N, Gold-YOLO-S, Gold-YOLO-M, Gold-YOLO-L

If you don't find your model in the list, it is possible that it can be converted, however, this is not guaranteed.

๐Ÿ“ Credits

This application uses source code of the following repositories: YOLOv5, YOLOv6, GoldYOLO YOLOv7, and Ultralytics (see each of them for more information).

๐Ÿ“„ License

This application is available under AGPL-3.0 License license (see LICENSE file for details).

๐Ÿค Contributing

We welcome contributions! Whether it's reporting bugs, adding features or improving documentation, your help is much appreciated. Please create a pull request (here's how to do it) and assign anyone from the Luxonis team to review the suggested changes. Cheers!

About

Conversion tools for YOLO models to use on OAK cameras

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 13