Shortcuts

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
  • 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’].

Return type

None

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

Return type

TextDetDataSample

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]

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.