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)[源代码]¶
Decoding predictions of FCENet to instances.
- 参数
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) –
- 返回类型
- get_text_instances(pred_results, data_sample)[源代码]¶
Get text instance predictions of one image.
- 参数
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.
- 返回
A new DataSample with predictions filled in. Polygons and results are saved in
TextDetDataSample.pred_instances.polygons
. The confidence scores are saved inTextDetDataSample.pred_instances.scores
.- 返回类型
- 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.- 参数
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)\).- 返回
N lists. Each list contains three dicts from different feature level.
- 返回类型