# exporter

Python API: `modelconverter.platforms.rvc3.exporter`

Export of models to the RVC3 platform.

The pipeline is the RVC2 one -- `mo` produces an OpenVINO IR that `compile_tool` compiles into a blob -- with INT8 post-training
quantization by OpenVINO's POT inserted before the compilation. It runs inside the RVC3 Docker image.

## Classes

### RVC3Exporter

Exporter producing an RVC3 blob, quantized to INT8 by default.

Reuses the OpenVINO conversion of
[RVC2Exporter](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/exporter.md)
but compiles for the `VPUX.3400` device and, unless calibration is disabled, quantizes the IR with POT before compiling it.

#### Methods

##### init

```python
def __init__(config: SingleStageConfig, output_dir: Path):
```

Initialize the exporter from the RVC3 configuration.

Parameters

 * `config` (`SingleStageConfig`): Configuration of the stage to export. Its `rvc3` section supplies the RVC3-specific options.
 * `output_dir` (`Path`): Directory the compiled model and the build information are written to.

##### export

```python
def export(self) -> Path:
```

Convert the model and compile it for RVC3.

A TFLite input is first converted to ONNX, an ONNX input is converted to an OpenVINO IR and an IR input is used as it is. Unless
calibration is disabled, the IR is then quantized to INT8 and the quantized model is the one compiled; in that case the process
exits with an error for models with more than one input, which quantization does not support yet.

Returns

 * `Path`: Path to the compiled `.blob`.

Raises

 * `NotImplementedError`: If the input file type is neither TFLite, ONNX nor OpenVINO IR.
