Shortcuts

PANPostprocessor

class mmocr.models.textdet.PANPostprocessor(text_repr_type='poly', score_threshold=0.3, rescale_fields=['polygons'], min_text_confidence=0.5, min_kernel_confidence=0.5, distance_threshold=3.0, min_text_area=16, downsample_ratio=0.25)[source]

Convert scores to quadrangles via post processing in PANet. This is partially adapted from https://github.com/WenmuZhou/PAN.pytorch.

Parameters
  • text_repr_type (str) – The boundary encoding type ‘poly’ or ‘quad’. Defaults to ‘poly’.

  • score_threshold (float) – The minimal text score. Defaults to 0.3.

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

  • min_text_confidence (float) – The minimal text confidence. Defaults to 0.5.

  • min_kernel_confidence (float) – The minimal kernel confidence. Defaults to 0.5.

  • distance_threshold (float) – The minimal distance between the point to mean of text kernel. Defaults to 3.0.

  • min_text_area (int) – The minimal text instance region area. Defaults to 16.

  • downsample_ratio (float) – Downsample ratio. Defaults to 0.25.

Return type

None

get_text_instances(pred_results, data_sample, **kwargs)[source]

Get text instance predictions of one image.

Parameters
Returns

A new 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

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.