VisualizationHook¶
- class mmcls.engine.hooks.VisualizationHook(enable=False, interval=5000, show=False, out_dir=None, **kwargs)[source]¶
Classification Visualization Hook. Used to visualize validation and testing prediction results.
If
out_dir
is specified, all storage backends are ignored and save the image to theout_dir
.If
show
is True, plot the result image in a window, please confirm you are able to access the graphical interface.
- Parameters
enable (bool) – Whether to enable this hook. Defaults to False.
interval (int) – The interval of samples to visualize. Defaults to 5000.
show (bool) – Whether to display the drawn image. Defaults to False.
out_dir (str, optional) – directory where painted images will be saved in the testing process. If None, handle with the backends of the visualizer. Defaults to None.
**kwargs – other keyword arguments of
mmcls.visualization.ClsVisualizer.add_datasample()
.
- after_test_iter(runner, batch_idx, data_batch, outputs)[source]¶
Visualize every
self.interval
samples during test.