mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-10 04:09: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
|
||||
|
||||
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')
|
||||
|
||||
# TODO: Should this be "recognize", not "ocr" akin ocrd_tesserocr?
|
||||
log = getLogger('processor.CalamariRecognize')
|
||||
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue