PSEPostprocessor¶
- class mmocr.models.textdet.PSEPostprocessor(text_repr_type='poly', rescale_fields=['polygons'], min_kernel_confidence=0.5, score_threshold=0.3, min_kernel_area=0, min_text_area=16, downsample_ratio=0.25)[源代码]¶
Decoding predictions of PSENet to instances. This is partially adapted from https://github.com/whai362/PSENet.
- 参数
text_repr_type (str) – The boundary encoding type ‘poly’ or ‘quad’. Defaults to ‘poly’.
rescale_fields (list[str]) – The bbox/polygon field names to be rescaled. If None, no rescaling will be performed. Defaults to [‘polygons’].
min_kernel_confidence (float) – The minimal kernel confidence. Defaults to 0.5.
score_threshold (float) – The minimal text average confidence. Defaults to 0.3.
min_kernel_area (int) – The minimal text kernel area. Defaults to 0.
min_text_area (int) – The minimal text instance region area. Defaults to 16.
downsample_ratio (float) – Downsample ratio. Defaults to 0.25.
- 返回类型
- get_text_instances(pred_results, data_sample, **kwargs)[源代码]¶
- 参数
pred_result (torch.Tensor) – Prediction results of an image which is a tensor of shape \((N, H, W)\).
data_sample (TextDetDataSample) – Datasample of an image.
pred_results (torch.Tensor) –
- 返回
A new DataSample with predictions filled in. Polygons and results are saved in
TextDetDataSample.pred_instances.polygons
. The confidence scores are saved inTextDetDataSample.pred_instances.scores
.- 返回类型