🚧 s/Ocr/Recognize

fix/readme-no-checkpoint
Gerber, Mike 5 years ago
parent 611371fa2c
commit 319ce3a467

@ -1,10 +1,10 @@
import click
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
from ocrd_calamari.ocr import CalamariOcr
from ocrd_calamari.recognize import CalamariRecognize
@click.command()
@ocrd_cli_options
def ocrd_calamari_ocr(*args, **kwargs):
return ocrd_cli_wrap_processor(CalamariOcr, *args, **kwargs)
def ocrd_calamari_recognize(*args, **kwargs):
return ocrd_cli_wrap_processor(CalamariRecognize, *args, **kwargs)

@ -2,8 +2,8 @@
"git_url": "https://github.com/kba/ocrd_calamari",
"version": "0.0.1",
"tools": {
"ocrd-calamari-ocr": {
"executable": "ocrd-calamari-ocr",
"ocrd-calamari-recognize": {
"executable": "ocrd-calamari-recognize",
"categories": [
"Text recognition and optimization"
],

@ -15,16 +15,14 @@ from ocrd_utils import getLogger, concat_padded, polygon_from_points, MIMETYPE_P
from ocrd_calamari.config import OCRD_TOOL, TF_CPP_MIN_LOG_LEVEL
log = getLogger('processor.CalamariOcr')
log = getLogger('processor.CalamariRecognize')
# TODO: Should this be "recognize", not "ocr" akin ocrd_tesserocr?
class CalamariOcr(Processor):
class CalamariRecognize(Processor):
def __init__(self, *args, **kwargs):
kwargs['ocrd_tool'] = OCRD_TOOL['tools']['ocrd-calamari-ocr']
super(CalamariOcr, self).__init__(*args, **kwargs)
kwargs['ocrd_tool'] = OCRD_TOOL['tools']['ocrd-calamari-recognize']
super(CalamariRecognize, self).__init__(*args, **kwargs)
def _init_calamari(self):
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL

@ -24,7 +24,7 @@ setup(
},
entry_points={
'console_scripts': [
'ocrd-calamari-ocr=ocrd_calamari.cli:ocrd_calamari_ocr',
'ocrd-calamari-recognize=ocrd_calamari.cli:ocrd_calamari_recognize',
]
},
)

Loading…
Cancel
Save