Shortcuts

VisualizationHook

class mmocr.engine.hooks.VisualizationHook(enable=False, interval=50, score_thr=0.3, show=False, draw_pred=False, draw_gt=False, wait_time=0.0, backend_args=None)[source]

Detection Visualization Hook. Used to visualize validation and testing process prediction results.

Parameters
  • enable (bool) – Whether to enable this hook. Defaults to False.

  • interval (int) – The interval of visualization. Defaults to 50.

  • score_thr (float) – The threshold to visualize the bboxes and masks. It’s only useful for text detection. Defaults to 0.3.

  • show (bool) – Whether to display the drawn image. Defaults to False.

  • wait_time (float) – The interval of show in seconds. Defaults to 0.

  • backend_args (dict, optional) – Instantiates the corresponding file backend. It may contain backend key to specify the file backend. If it contains, the file backend corresponding to this value will be used and initialized with the remaining values, otherwise the corresponding file backend will be selected based on the prefix of the file path. Defaults to None.

  • draw_pred (bool) –

  • draw_gt (bool) –

Return type

None

after_test_iter(runner, batch_idx, data_batch, outputs)[source]

Run after every testing iterations.

Parameters
Return type

None

:param outputs (Sequence[TextDetDataSample or: TextRecogDataSample]): Outputs from model.

after_val_iter(runner, batch_idx, data_batch, outputs)[source]

Run after every self.interval validation iterations.

Parameters
Return type

None

:param outputs (Sequence[TextDetDataSample or: TextRecogDataSample]): Outputs from model.

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.