Shortcuts

FCEPostprocessor

class mmocr.models.textdet.FCEPostprocessor(fourier_degree, num_reconstr_points, rescale_fields=['polygons'], scales=[8, 16, 32], text_repr_type='poly', alpha=1.0, beta=2.0, score_thr=0.3, nms_thr=0.1, **kwargs)[source]

Decoding predictions of FCENet to instances.

Parameters
  • fourier_degree (int) – The maximum Fourier transform degree k.

  • num_reconstr_points (int) – The points number of the polygon reconstructed from predicted Fourier coefficients.

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

  • scales (list[int]) – The down-sample scale of each layer. Defaults to [8, 16, 32].

  • text_repr_type (str) –

    Boundary encoding type ‘poly’ or ‘quad’. Defaults

    to ‘poly’.

    alpha (float): The parameter to calculate final scores

    \(Score_{final} = (Score_{text region} ^ alpha) * (Score_{text center_region}^ beta)\). Defaults to 1.0.

  • beta (float) – The parameter to calculate final score. Defaults to 2.0.

  • score_thr (float) – The threshold used to filter out the final candidates.Defaults to 0.3.

  • nms_thr (float) – The threshold of nms. Defaults to 0.1.

  • alpha (float) –

Return type

None

get_text_instances(pred_results, data_sample)[source]

Get text instance predictions of one image.

Parameters
  • pred_results (List[dict]) – A list of dict with keys of cls_res, reg_res corresponding to the classification result and regression result computed from the input tensor with the same index. They have the shapes of \((N, C_{cls,i}, H_i, W_i)\) and \((N, C_{out,i}, H_i, W_i)\).

  • data_sample (TextDetDataSample) – Datasample of an image.

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

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.

Parameters

pred_results (list[dict]) – A list of dict with keys of cls_res, reg_res corresponding to the classification result and regression result computed from the input tensor with the same index. They have the shapes of \((N, C_{cls,i}, H_i, W_i)\) and \((N, C_{out,i}, H_i, W_i)\).

Returns

N lists. Each list contains three dicts from different feature level.

Return type

list[list[dict]]

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.