# getters

Python API: `modelconverter.platforms.getters`

Factories for the platform-specific conversion components.

Every conversion platform (RVC2, RVC3, RVC4 and Hailo) provides its own exporter and inferer; the benchmark is missing for Hailo,
and the analyzer and the visualizer are provided by RVC4 only. The getters in this module map a
[Platform](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/utils/types.md)
to the matching implementation and import it lazily, so that only the dependencies of the selected component need to be available.
The exporter and inferer dependencies live in the platform's Docker image; the host-run benchmark, analyzer and visualizer take
theirs from the host environment.

## Functions

### get_analyzer

```python
def get_analyzer(platform: Platform, *args, **kwargs) -> Analyzer:
```

Create the
[Analyzer](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/base_analyze.md)
implementation for the given platform.

Only RVC4 provides an analyzer.

Parameters

 * `platform` (`Platform`): Platform the model was converted for.
 * `*args`: Positional arguments passed to the analyzer constructor.
 * `**kwargs`: Keyword arguments passed to the analyzer constructor.

Returns

 * `Analyzer`: Analyzer for the given platform.

Raises

 * `ValueError`: If `platform` is not `Platform.RVC4`.

### get_benchmark

```python
def get_benchmark(platform: Platform, *args, **kwargs) -> Benchmark:
```

Create the
[Benchmark](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/base_benchmark.md)
implementation for the given platform.

Parameters

 * `platform` (`Platform`): Platform to benchmark the model on.
 * `*args`: Positional arguments passed to the benchmark constructor.
 * `**kwargs`: Keyword arguments passed to the benchmark constructor.

Returns

 * `Benchmark`: Benchmark for the given platform.

Raises

 * `NotImplementedError`: If `platform` is `Platform.HAILO`.

### get_exporter

```python
def get_exporter(platform: Platform, *args, **kwargs) -> Exporter:
```

Create the
[Exporter](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/base_exporter.md)
implementation for the given platform.

Parameters

 * `platform` (`Platform`): Platform the model is converted for.
 * `*args`: Positional arguments passed to the exporter constructor.
 * `**kwargs`: Keyword arguments passed to the exporter constructor.

Returns

 * `Exporter`: Exporter for the given platform.

### get_inferer

```python
def get_inferer(platform: Platform, *args, **kwargs) -> Inferer:
```

Create the
[Inferer](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/base_inferer.md)
implementation for the given platform.

The inferer is constructed using its `from_config` constructor.

Parameters

 * `platform` (`Platform`): Platform the model was converted for.
 * `*args`: Positional arguments passed to `from_config`.
 * `**kwargs`: Keyword arguments passed to `from_config`.

Returns

 * `Inferer`: Inferer for the given platform.

### get_visualizer

```python
def get_visualizer(platform: Platform, *args, **kwargs) -> Visualizer:
```

Create the
[Visualizer](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/base_visualize.md)
implementation for the given platform.

Only RVC4 provides a visualizer.

Parameters

 * `platform` (`Platform`): Platform the model was converted for.
 * `*args`: Positional arguments passed to the visualizer constructor.
 * `**kwargs`: Keyword arguments passed to the visualizer constructor.

Returns

 * `Visualizer`: Visualizer for the given platform.

Raises

 * `ValueError`: If `platform` is not `Platform.RVC4`.
