Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to v3 #44

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
901098a
bump requirement to ocrd >= 3.0.0a1
kba Aug 11, 2024
78849a9
port binarize to v3
kba Aug 11, 2024
30db9a4
port segment to v3
kba Aug 11, 2024
9ea80c7
port recognize to v3
kba Aug 11, 2024
163ee7d
ocrd-tool.json: add cardinality specs
bertsky Aug 13, 2024
41b0045
test_binarize.py: use stable API
bertsky Aug 13, 2024
340f513
test_recognize.py: use stable API
bertsky Aug 13, 2024
cd0ce01
test_segment.py: use stable API
bertsky Aug 13, 2024
4671e98
remove fileGrp cardinality assertions
bertsky Aug 13, 2024
a497287
binarize: re-instate setup for logger
bertsky Aug 14, 2024
c0c1eb7
adapt to bertsky/core#8
kba Aug 14, 2024
712d1d3
Merge branch 'port-to-v3' of https://github.com/OCR-D/ocrd_kraken int…
kba Aug 14, 2024
e8ec7fe
require regex
kba Aug 15, 2024
e76d708
update to OcrdPageResult change
kba Aug 15, 2024
2832722
update to latest OcrdPageResult and process_page_pcgts
kba Aug 15, 2024
a8a859b
CI: switch back to Ubuntu
bertsky Aug 15, 2024
0e30138
self.logger: adapt to bertsky/core#10
kba Aug 19, 2024
6d287b0
tests: migrate unittest→pytest, simplify
bertsky Aug 29, 2024
316eedb
tests: base→conftest
bertsky Aug 29, 2024
43c600f
tests: also w/ METS server + page-parallel and w/ METS caching
bertsky Aug 30, 2024
32b2e9c
remove v2 tool facility
bertsky Aug 30, 2024
c73b3ef
tests: use workspace manifesto→aufklaerung (1→2 pages), binarize ad h…
bertsky Aug 30, 2024
a23d4c3
tests: avoid running into 'too many failures'
bertsky Aug 30, 2024
ae6445b
update v3 requirement
bertsky Aug 30, 2024
fd15e2a
tests: add actual assertions
bertsky Aug 30, 2024
43a88ea
update v3 requirement
bertsky Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ocrd_kraken/binarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ class KrakenBinarize(Processor):
def executable(self):
return 'ocrd-kraken-binarize'

def setup(self):
self.logger = getLogger('processor.KrakenBinarize')
assert_file_grp_cardinality(self.input_file_grp, 1)
assert_file_grp_cardinality(self.output_file_grp, 1)

MehmedGIT marked this conversation as resolved.
Show resolved Hide resolved
def process_page_pcgts(self, *input_pcgts : OcrdPage, output_file_id : Optional[str] = None, page_id : Optional[str] = None) -> OcrdPage:
"""Binarize the pages/regions/lines with Kraken.

Expand Down
4 changes: 1 addition & 3 deletions ocrd_kraken/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ def executable(self):

def setup(self):
"""
Assert filegrp cardinality, load model, set predict function
Load model, set predict function
"""
assert_file_grp_cardinality(self.input_file_grp, 1)
assert_file_grp_cardinality(self.output_file_grp, 1)

self.logger = getLogger('processor.KrakenRecognize')
import torch
Expand Down
2 changes: 0 additions & 2 deletions ocrd_kraken/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def setup(self):
Load models
"""
self.logger = getLogger('processor.KrakenSegment')
assert_file_grp_cardinality(self.input_file_grp, 1)
assert_file_grp_cardinality(self.output_file_grp, 1)
kwargs = {}
kwargs['text_direction'] = self.parameter['text_direction']
self.use_legacy = self.parameter['use_legacy']
Expand Down
Loading