🚧 s/Ocr/Recognize

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

@ -1,10 +1,10 @@
import click import click
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor 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() @click.command()
@ocrd_cli_options @ocrd_cli_options
def ocrd_calamari_ocr(*args, **kwargs): def ocrd_calamari_recognize(*args, **kwargs):
return ocrd_cli_wrap_processor(CalamariOcr, *args, **kwargs) return ocrd_cli_wrap_processor(CalamariRecognize, *args, **kwargs)

@ -2,8 +2,8 @@
"git_url": "https://github.com/kba/ocrd_calamari", "git_url": "https://github.com/kba/ocrd_calamari",
"version": "0.0.1", "version": "0.0.1",
"tools": { "tools": {
"ocrd-calamari-ocr": { "ocrd-calamari-recognize": {
"executable": "ocrd-calamari-ocr", "executable": "ocrd-calamari-recognize",
"categories": [ "categories": [
"Text recognition and optimization" "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 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 CalamariRecognize(Processor):
class CalamariOcr(Processor):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
kwargs['ocrd_tool'] = OCRD_TOOL['tools']['ocrd-calamari-ocr'] kwargs['ocrd_tool'] = OCRD_TOOL['tools']['ocrd-calamari-recognize']
super(CalamariOcr, self).__init__(*args, **kwargs) super(CalamariRecognize, self).__init__(*args, **kwargs)
def _init_calamari(self): def _init_calamari(self):
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL

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

Loading…
Cancel
Save