processor: self.resolve_resource model

resolve-resources
Konstantin Baierer 4 years ago
parent 451b71f906
commit 5c7fd26883

@ -46,6 +46,7 @@ class OcrdSbbTextlineDetectorRecognize(Processor):
log = getLogger('processor.OcrdSbbTextlineDetectorRecognize') log = getLogger('processor.OcrdSbbTextlineDetectorRecognize')
assert_file_grp_cardinality(self.input_file_grp, 1) assert_file_grp_cardinality(self.input_file_grp, 1)
assert_file_grp_cardinality(self.output_file_grp, 1) assert_file_grp_cardinality(self.output_file_grp, 1)
model = self.resolve_resource(self.parameter['model'])
for (n, input_file) in enumerate(self.input_files): for (n, input_file) in enumerate(self.input_files):
page_id = input_file.pageId or input_file.ID page_id = input_file.pageId or input_file.ID
@ -73,7 +74,6 @@ class OcrdSbbTextlineDetectorRecognize(Processor):
page_image.save(image_file) page_image.save(image_file)
# Segment the image # Segment the image
model = self.parameter['model']
x = textline_detector(image_file, tmp_dirname, file_id, model) x = textline_detector(image_file, tmp_dirname, file_id, model)
x.run() x.run()

@ -9,5 +9,5 @@ scikit-learn
numpy == 1.18.* # XXX for tensorflow-gpu 1.15 numpy == 1.18.* # XXX for tensorflow-gpu 1.15
tensorflow-gpu == 1.15.* tensorflow-gpu == 1.15.*
scipy scipy
ocrd >= 2.18.0 ocrd >= 2.22.3
shapely >= 1.7.1 shapely >= 1.7.1

Loading…
Cancel
Save