DRRGPostprocessor¶
- class mmocr.models.textdet.DRRGPostprocessor(link_thr=0.8, edge_len_thr=50.0, rescale_fields=['polygons'], **kwargs)[源代码]¶
Merge text components and construct boundaries of text instances.
- 参数
- 返回类型
- get_text_instances(pred_results, data_sample)[源代码]¶
Get text instance predictions of one image.
- 参数
pred_result (tuple(ndarray, ndarray, ndarray)) – Prediction results edge, score and text_comps. Each of shape \((N_{edges}, 2)\), \((N_{edges},)\) and \((M, 9)\), respectively.
data_sample (TextDetDataSample) – Datasample of an image.
pred_results (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]) –
- 返回
The original dataSample with predictions filled in. Polygons and results are saved in
TextDetDataSample.pred_instances.polygons
. The confidence scores are saved inTextDetDataSample.pred_instances.scores
.- 返回类型
- split_results(pred_results)[源代码]¶
Split batched elements in pred_results along the first dimension into
batch_num
sub-elements and regather them into a list of dicts.However, DRRG only outputs one batch at inference time, so this function is a no-op.
- 参数
pred_results (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]) –
- 返回类型
List[Tuple]