# 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

### RVC2Benchmark

Benchmark of a model running on a connected RVC2 device.

#### Methods

##### benchmark

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

Run a single benchmark of the model on the device.

Parameters

 * `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)
   must be present.

Returns

 * `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.

#### Attributes

##### all_configurations

Return the configurations used by the full benchmark.

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

##### default_configuration

Default configuration for RVC2 benchmarking.

 * `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). num_messages: The number of messages measured for each report.
   num_threads: The number of threads to use for inference.
