# benchmark

Python API: `modelconverter.platforms.rvc2.benchmark`

Benchmarking of converted models on an RVC2 device.

Runs a `.blob` or an NN Archive on a connected RVC2 device through a DepthAI benchmark pipeline, feeding it random data of the
shape the model declares, and reports the throughput and the inference latency the device logs.

## Classes

| Name | Description |
| --- | --- |
| [`RVC2Benchmark`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/benchmark.md#benchmark-Classes-RVC2Benchmark) | Benchmark of a model running on a connected RVC2 device. |

### class `RVC2Benchmark`

```python
class RVC2Benchmark(Benchmark)
```

Benchmark of a model running on a connected RVC2 device.

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`all_configurations`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/benchmark.md#benchmark-Classes-RVC2Benchmark-all_configurations) | `list[Configuration]` | The configurations used by the full benchmark. |
| [`default_configuration`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/benchmark.md#benchmark-Classes-RVC2Benchmark-default_configuration) | `Configuration` | Default configuration for RVC2 benchmarking. |

Methods

| Name | Description |
| --- | --- |
| [`benchmark`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/benchmark.md#benchmark-Classes-RVC2Benchmark-benchmark) | Run a single benchmark of the model on the device. |

#### property `all_configurations`

```python
all_configurations: list[Configuration]
```

The configurations used by the full benchmark.

Covers one, two and three inference threads, leaving the remaining options to the caller.

#### property `default_configuration`

```python
default_configuration: Configuration
```

Default configuration for RVC2 benchmarking.

 * `Configuration options:`: * `repetitions`: The number of repetitions to perform (ignored if `benchmark_time` is set).
    * `benchmark_time`: Duration in seconds for time-based benchmarking (overrides `repetitions`).
    * `input_fps`: Rate at which inputs are sent. `-1` removes the limit.
    * `num_messages`: The number of messages measured for each report.
    * `num_threads`: The number of threads to use for inference.

#### method `benchmark`

```python
def benchmark(configuration: Configuration) -> Result
```

Run a single benchmark of the model on the device.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `configuration` | `Configuration` | Configuration to benchmark with. All the options of [default_configuration](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc2/benchmark.md#benchmark-Classes-RVC2Benchmark-default_configuration) must be present. | required |

Returns

| Type | Description |
| --- | --- |
| `Result` | The mean throughput under `fps` and the mean inference latency in milliseconds under `latency`, the latter being `"N/A"` when the device logged no latency at all. |
