# Model Upload/Download

## Overview

Once your model is prepared, you can easily upload it to the Model Registry or download any model you have permission to access.
This section provides a simple, step-by-step guide to both processes.

## Upload Guidelines

> It is assumed here that you already have the
> **Model File(s)**
> and
> **Model Card**
> prepared. If this is not the case, please refer to the
> [Model Preparation](https://docs.luxonis.com/cloud/hubai/model-registry/preparation.md)
> guidelines.

> For custom model conversion, prefer uploading an
> **ONNX NN Archive**
> instead of a raw ONNX file whenever possible. The archive carries preprocessing, tensor metadata, and optional
> `heads`
> metadata into the conversion flow, which greatly reduces manual setup and usually produces a converted archive that is ready to
use in DepthAI.

Step by step instructions:

#### Open Models and click Add Model

Open [Hub](https://hub.luxonis.com/ai), navigate to the [Models](https://hub.luxonis.com/ai/models) section, and click Add Model.

#### Choose the upload type

Select the model type you want to upload. Use YOLO for supported PyTorch YOLO weights and Custom for ONNX NN Archives, raw ONNX,
OpenVINO IR, TensorFlow Lite, or already compiled RVC model artifacts.

#### Choose the target platform for YOLO

If you selected YOLO, choose the target RVC platform for the conversion.

#### Fill in model details and upload the files

Fill in the required descriptors, upload the model file(s), and confirm the action with Add or Export. Use the reference sections
below for the exact meaning of the common metadata fields and the YOLO-specific parameters.

#### Add another version if needed

If you want to store another version of the same model, click Add Version and upload it as a separate version entry.

#### Copy the model version reference

After the upload is complete, use the Copy button next to the version you want to reference from DepthAI or other tooling.

### Upload Type Reference

| Upload type | Use it when |
| --- | --- |
| `YOLO` | Uploading supported PyTorch YOLO weights (`.pt`) that Hub can convert directly |
| `Custom` | Uploading `ONNX` NN Archives, raw `ONNX`, OpenVINO IR, TensorFlow Lite, or already compiled `RVC` model artifacts |

### Common metadata fields

| Parameter | Meaning |
| --- | --- |
| `Model Name` | Name used to reference the model through Hub |
| `Model Version` | Version identifier such as `1.0.0` |
| `License` | License that governs the use and distribution of the model |
| `Public` | Controls whether the model is visible to other Hub users outside your team |
| `Short Description` | Short summary shown under the model thumbnail |
| `Model Image` | Preview image illustrating the model |
| `Tasks` | Machine learning tasks handled by the model |

### YOLO-specific parameters

| Parameter | Meaning |
| --- | --- |
| `Model Instance Name` | Name of the converted model instance |
| `Version` | YOLO version of the uploaded model |
| `Class Names` | List of output class names |
| `Shape` | Input shape of the model |
| `Quantization Data` | Dataset used to calibrate quantized conversion for `RVC3` and `RVC4` |
| `POT Target Device` | POT target device for `RVC3` |

Hub allows upload of multiple versions of the same model, for example when models were exported with different input shapes or
trained on different datasets.

> For public models, follow a consistent version naming scheme. The version name should not include the model name and should
contain only the descriptors needed to distinguish variants. Separate descriptors with a single space, and keep the input shape (
> `input_height x input_width`
> ) as the last descriptor.

> Can't find a model you are looking for or have issues with uploading your model? Feel free to fill-in the
> [model request form](https://forms.gle/k3YbHTUy4Wvn9tEv9)
> . We will do our best to support the most requested models.

## Download Guidelines

To download a model from Hub, first open the desired public or private model and select the version you want to inspect.

#### Open the model version

Open [Hub](https://hub.luxonis.com/ai), navigate to [Models](https://hub.luxonis.com/ai/models), open the model, scroll to Model
Versions, and click the desired version.

### Base Model

#### Choose Base Model

To download the unconverted model, open the menu in the top right corner and choose Base Model.

#### Start the download

In the pop-up window, click the model name to start the download.

### Converted Model

#### Open the converted instance

To download a converted model, click the name of the converted instance from the selected model version.

#### Download the converted archive

In the pop-up window, click the .tar.xz file to start the download.
