From 4df04ac6d763b4e692be702ac819d5f6e0ab03fd Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 8 Aug 2019 12:31:46 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Update=20to=20ocrd=20>=3D=201.0.?= =?UTF-8?q?0b11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ocrd_calamari/ocr.py | 14 +++++++------- requirements.txt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ocrd_calamari/ocr.py b/ocrd_calamari/ocr.py index 2930bb2..f0dc7d2 100644 --- a/ocrd_calamari/ocr.py +++ b/ocrd_calamari/ocr.py @@ -7,12 +7,12 @@ import numpy as np from calamari_ocr.ocr import MultiPredictor from calamari_ocr.ocr.voting import voter_from_proto from calamari_ocr.proto import VoterParams -from ocrd import Processor, MIMETYPE_PAGE -from ocrd.logging import getLogger -from ocrd.model import ocrd_page -from ocrd.model.ocrd_page import to_xml -from ocrd.model.ocrd_page_generateds import TextEquivType -from ocrd.utils import polygon_from_points, concat_padded +from ocrd import Processor +from ocrd_modelfactory import page_from_file +from ocrd_models import ocrd_page +from ocrd_models.ocrd_page import to_xml +from ocrd_models.ocrd_page_generateds import TextEquivType +from ocrd_utils import getLogger, concat_padded, polygon_from_points, MIMETYPE_PAGE from ocrd_calamari.config import OCRD_TOOL @@ -53,7 +53,7 @@ class CalamariOcr(Processor): for (n, input_file) in enumerate(self.input_files): log.info("INPUT FILE %i / %s", n, input_file) - pcgts = ocrd_page.from_file(self.workspace.download_file(input_file)) + pcgts = page_from_file(self.workspace.download_file(input_file)) image_url = pcgts.get_Page().imageFilename log.info("pcgts %s", pcgts) for region in pcgts.get_Page().get_TextRegion(): diff --git a/requirements.txt b/requirements.txt index 552c477..9d528c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ numpy calamari-ocr tensorflow-gpu click -ocrd \ No newline at end of file +ocrd >= 1.0.0b11 \ No newline at end of file