diff --git a/src/eynollah/ocrd-tool-binarization.json b/src/eynollah/ocrd-tool-binarization.json deleted file mode 100644 index 1711e89..0000000 --- a/src/eynollah/ocrd-tool-binarization.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "version": "0.1.0", - "git_url": "https://github.com/qurator-spk/sbb_binarization", - "tools": { - "ocrd-sbb-binarize": { - "executable": "ocrd-sbb-binarize", - "description": "Pixelwise binarization with selectional auto-encoders in Keras", - "categories": ["Image preprocessing"], - "steps": ["preprocessing/optimization/binarization"], - "input_file_grp": [], - "output_file_grp": [], - "parameters": { - "operation_level": { - "type": "string", - "enum": ["page", "region"], - "default": "page", - "description": "PAGE XML hierarchy level to operate on" - }, - "model": { - "description": "Directory containing HDF5 or SavedModel/ProtoBuf models. Can be an absolute path or a path relative to the OCR-D resource location, the current working directory or the $SBB_BINARIZE_DATA environment variable (if set)", - "type": "string", - "format": "uri", - "content-type": "text/directory", - "required": true - } - }, - "resources": [ - { - "url": "https://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2020_01_16.zip", - "name": "default", - "type": "archive", - "path_in_archive": "saved_model_2020_01_16", - "size": 563147331, - "description": "default models provided by github.com/qurator-spk (SavedModel format)" - }, - { - "url": "https://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2021_03_09.zip", - "name": "default-2021-03-09", - "type": "archive", - "path_in_archive": ".", - "size": 133230419, - "description": "updated default models provided by github.com/qurator-spk (SavedModel format)" - } - ] - } - } -} diff --git a/src/eynollah/ocrd-tool.json b/src/eynollah/ocrd-tool.json index e35f874..e7f1585 100644 --- a/src/eynollah/ocrd-tool.json +++ b/src/eynollah/ocrd-tool.json @@ -13,10 +13,10 @@ "parameters": { "models": { "type": "string", - "format": "file", + "format": "uri", "content-type": "text/directory", "cacheable": true, - "description": "Path to directory containing models to be used (See https://qurator-data.de/eynollah)", + "description": "Directory containing models to be used (See https://qurator-data.de/eynollah)", "required": true }, "dpi": { diff --git a/src/eynollah/processor.py b/src/eynollah/processor.py index 812ba25..b5b9cb2 100644 --- a/src/eynollah/processor.py +++ b/src/eynollah/processor.py @@ -9,11 +9,16 @@ class EynollahProcessor(Processor): # already employs GPU (without singleton process atm) max_workers = 1 + @property + def executable(self): + return 'ocrd-eynollah-segment' + def setup(self) -> None: # for caching models self.models = None - if self.parameter['textline_light'] and not self.parameter['light_mode']: - raise ValueError("Error: You set parameter 'textline_light' to enable light textline detection but parameter 'light_mode' is not enabled") + if self.parameter['textline_light'] and not self.parameter['light_version']: + raise ValueError("Error: You set parameter 'textline_light' to enable light textline detection, " + "but parameter 'light_version' is not enabled") def process_page_pcgts(self, *input_pcgts: Optional[OcrdPage], page_id: Optional[str] = None) -> OcrdPageResult: """