# visualize

Python API: `modelconverter.platforms.rvc4.visualize`

Visualization of the RVC4 analysis results.

Turns the CSV reports written by the RVC4 analyzer into interactive `plotly` figures: one comparing the per-layer outputs of the
quantized model with the original ONNX model, and one comparing the per-layer inference times. Both are saved as HTML files that
load `plotly.js` from a CDN.

## Classes

| Name | Description |
| --- | --- |
| [`RVC4Visualizer`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc4/visualize.md#visualize-Classes-RVC4Visualizer) | Visualizer of the CSV reports produced by the RVC4 analyzer. |

### class `RVC4Visualizer`

```python
class RVC4Visualizer(Visualizer)
```

Visualizer of the CSV reports produced by the RVC4 analyzer.

Collects the layer comparison and layer cycles CSV files lying directly in the analysis directory -- keyed by the name of that
directory, which the analyzer names after the model -- and plots one series per key.

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc4/visualize.md#visualize-Classes-RVC4Visualizer-__init__) | Initialize the visualizer and locate the CSV reports. |
| [`visualize`](https://docs.luxonis.com/software-v3/ai-inference/conversion/rvc-conversion/offline/modelconverter/modelconverter-api-reference/platforms/rvc4/visualize.md#visualize-Classes-RVC4Visualizer-visualize) | Create, save and show the analysis figures. |

#### method `__init__`

```python
def __init__(dir_path: str | None = None)
```

Initialize the visualizer and locate the CSV reports.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `dir_path` | `str | None` | Directory containing the analysis results. If `None`, the `analysis` subdirectory of the default output directory is used. | `None` |

#### method `visualize`

```python
def visualize()
```

Create, save and show the analysis figures.

Writes `layer_outputs_visual.html` and `layer_cycles_visual.html` into the analysis directory and opens both figures.
