DRRGPostprocessor¶
- class mmocr.models.textdet.DRRGPostprocessor(link_thr=0.8, edge_len_thr=50.0, rescale_fields=['polygons'], **kwargs)[source]¶
Merge text components and construct boundaries of text instances.
- Parameters
- Return type
- get_text_instances(pred_results, data_sample)[source]¶
Get text instance predictions of one image.
- Parameters
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]) –
- Returns
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
.- Return type
- split_results(pred_results)[source]¶
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.
- Parameters
pred_results (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]) –
- Return type
List[Tuple]