This repository was archived by the owner on Feb 19, 2024. It is now read-only.
File tree 3 files changed +5
-4
lines changed
ocrd_typegroups_classifier
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 17
17
"network" : {
18
18
"description" : " The file name of the neural network to use, including sufficient path information" ,
19
19
"type" : " string" ,
20
- "required" : true
20
+ "required" : false
21
21
},
22
22
"stride" : {
23
23
"description" : " Stride applied to the CNN on the image. Should be between 1 and 224. Smaller values increase the computation time." ,
Original file line number Diff line number Diff line change 1
1
"""
2
2
Wrap TypegroupsClassifier as an ocrd.Processor
3
3
"""
4
+ from pkg_resources import resource_filename
4
5
5
6
from ocrd import Processor
6
7
from ocrd_utils import (
@@ -43,6 +44,8 @@ def process(self):
43
44
log = getLogger ('ocrd_typegroups_classifier' )
44
45
assert_file_grp_cardinality (self .input_file_grp , 1 )
45
46
assert_file_grp_cardinality (self .output_file_grp , 1 )
47
+ if 'network' not in self .parameter :
48
+ self .parameter ['network' ] = resource_filename (__name__ , 'models/densenet121.tgc' )
46
49
network_file = self .parameter ['network' ]
47
50
stride = self .parameter ['stride' ]
48
51
classifier = TypegroupsClassifier .load (network_file )
Original file line number Diff line number Diff line change @@ -3,16 +3,14 @@ set -ex
3
3
4
4
SCRIPTDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd ) "
5
5
6
- net=" ${SCRIPTDIR} /../ocrd_typegroups_classifier/models/densenet121.tgc"
7
-
8
6
cd " $SCRIPTDIR /assets/pembroke_werke_1766/data"
9
7
ocrd-typegroups-classifier \
10
8
-l DEBUG \
11
9
-g PHYS_0011 \
12
10
-m mets.xml \
13
11
-I DEFAULT \
14
12
-O OCR-D-FONTIDENT \
15
- -p <( echo ' {"network": " ' " $net " ' ", " stride": 143} ' )
13
+ -P stride 143
16
14
17
15
outfile=" OCR-D-FONTIDENT/FILE_0010_OCR-D-FONTIDENT.xml"
18
16
expected_fontfamily=' fraktur'
You can’t perform that action at this time.
0 commit comments