From 319ce3a467bce5e11e97723925c00749fae3fc60 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 8 Aug 2019 13:48:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20s/Ocr/Recognize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ocrd_calamari/cli.py | 6 +++--- ocrd_calamari/ocrd-tool.json | 4 ++-- ocrd_calamari/{ocr.py => recognize.py} | 10 ++++------ setup.py | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) rename ocrd_calamari/{ocr.py => recognize.py} (94%) diff --git a/ocrd_calamari/cli.py b/ocrd_calamari/cli.py index 7a28dad..2a1e210 100644 --- a/ocrd_calamari/cli.py +++ b/ocrd_calamari/cli.py @@ -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) diff --git a/ocrd_calamari/ocrd-tool.json b/ocrd_calamari/ocrd-tool.json index 7216e87..e039d8e 100644 --- a/ocrd_calamari/ocrd-tool.json +++ b/ocrd_calamari/ocrd-tool.json @@ -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" ], diff --git a/ocrd_calamari/ocr.py b/ocrd_calamari/recognize.py similarity index 94% rename from ocrd_calamari/ocr.py rename to ocrd_calamari/recognize.py index 1aba218..6121885 100644 --- a/ocrd_calamari/ocr.py +++ b/ocrd_calamari/recognize.py @@ -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 diff --git a/setup.py b/setup.py index f82586d..ed24216 100644 --- a/setup.py +++ b/setup.py @@ -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', ] }, )