Shortcuts

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.

参数
  • link_thr (float) – The edge score threshold. Defaults to 0.8.

  • edge_len_thr (int or float) – The edge length threshold. Defaults to 50.

  • rescale_fields (list[str]) – The bbox/polygon field names to be rescaled. If None, no rescaling will be performed. Defaults to [polygons’].

返回类型

None

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 in TextDetDataSample.pred_instances.scores.

返回类型

TextDetDataSample

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]

Read the Docs v: dev-1.x
Versions
latest
stable
0.x
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.