Shortcuts

VisualizationHook

class mmpretrain.engine.hooks.VisualizationHook(enable=False, interval=5000, show=False, out_dir=None, **kwargs)[源代码]

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 the out_dir.

  • If show is True, plot the result image in a window, please confirm you are able to access the graphical interface.

参数:
  • 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 mmpretrain.visualization.UniversalVisualizer.visualize_cls().

after_test_iter(runner, batch_idx, data_batch, outputs)[源代码]

Visualize every self.interval samples during test.

参数:
  • runner (Runner) – The runner of the testing process.

  • batch_idx (int) – The index of the current batch in the test loop.

  • data_batch (dict) – Data from dataloader.

  • outputs (Sequence[DetDataSample]) – Outputs from model.

after_val_iter(runner, batch_idx, data_batch, outputs)[源代码]

Visualize every self.interval samples during validation.

参数:
  • runner (Runner) – The runner of the validation process.

  • batch_idx (int) – The index of the current batch in the val loop.

  • data_batch (dict) – Data from dataloader.

  • outputs (Sequence[DataSample]) – Outputs from model.

Read the Docs v: latest
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.