TextSpottingLocalVisualizer¶
- class mmocr.visualization.TextSpottingLocalVisualizer(name='visualizer', font_families='sans-serif', font_properties=None, **kwargs)[源代码]¶
- 参数
- 返回类型
- add_datasample(name, image, data_sample=None, draw_gt=True, draw_pred=True, show=False, wait_time=0, pred_score_thr=0.5, out_file=None, step=0)[源代码]¶
Draw datasample and save to all backends.
If GT and prediction are plotted at the same time, they are
displayed in a stitched image where the left image is the ground truth and the right image is the prediction. - If
show
is True, all storage backends are ignored, and the images will be displayed in a local window. - Ifout_file
is specified, the drawn image will be saved toout_file
. This is usually used when the display is not available.- 参数
name (str) – The image identifier.
image (np.ndarray) – The image to draw.
data_sample (
TextSpottingDataSample
, optional) –- TextDetDataSample which contains gt and prediction. Defaults
to None.
draw_gt (bool) – Whether to draw GT TextDetDataSample. Defaults to True.
draw_pred (bool) – Whether to draw Predicted TextDetDataSample. Defaults to True.
show (bool) – Whether to display the drawn image. Default to False.
wait_time (float) – The interval of show (s). Defaults to 0.
out_file (str) – Path to output file. Defaults to None.
pred_score_thr (float) – The threshold to visualize the bboxes and masks. Defaults to 0.3.
step (int) – Global step value to record. Defaults to 0.
- 返回类型