# 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

### RVC4Visualizer

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

##### init

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

Initialize the visualizer and locate the CSV reports.

Parameters

 * `dir_path` (`str | None`): Directory containing the analysis results. If `None`, the `analysis` subdirectory of the default
   output directory is used.

##### visualize

```python
def visualize(self):
```

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.
