mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-08 19:29:53 +02:00
🚧 s/Ocr/Recognize
This commit is contained in:
parent
611371fa2c
commit
319ce3a467
4 changed files with 10 additions and 12 deletions
|
@ -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 CalamariOcr(Processor):
|
class CalamariRecognize(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
|
2
setup.py
2
setup.py
|
@ -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…
Add table
Add a link
Reference in a new issue