Shortcuts

TextRecInferencer

class mmocr.apis.inferencers.TextRecInferencer(model=None, weights=None, device=None, scope='mmocr')[source]

Text Recognition inferencer.

Parameters
  • model (str, optional) – Path to the config file or the model name defined in metafile. For example, it could be “crnn_mini-vgg_5e_mj” or “configs/textrecog/crnn/crnn_mini-vgg_5e_mj.py”. If model is not specified, user must provide the weights saved by MMEngine which contains the config string. Defaults to None.

  • weights (str, optional) – Path to the checkpoint. If it is not specified and model is a model name of metafile, the weights will be loaded from metafile. Defaults to None.

  • device (str, optional) – Device to run inference. If None, the available device will be automatically used. Defaults to None.

  • scope (str, optional) – The scope of the model. Defaults to “mmocr”.

Return type

None

pred2dict(data_sample)[source]

Extract elements necessary to represent a prediction into a dictionary. It’s better to contain only basic data elements such as strings and numbers in order to guarantee it’s json-serializable.

Parameters

data_sample (TextRecogDataSample) – The data sample to be converted.

Returns

The output dictionary.

Return type

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.