Skip to content

Commit 4d68af1

Browse files
committed
Merge remote-tracking branch 'origin/anybaseocr-layout-analysis'
2 parents d1ab2a2 + 072294b commit 4d68af1

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

ocrd/ocrd/resource_list.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,23 @@ ocrd-anybaseocr-block-segmentation:
133133
description: block segmentation model for anybaseocr
134134
size: 256139800
135135
ocrd-anybaseocr-layout-analysis:
136-
- url: https://ocr-d-repo.scc.kit.edu/models/dfki/layoutAnalysis/structure_analysis.h5
137-
name: structure_analysis.h5
136+
- url: https://ocr-d.kba.cloud/structure_analysis.tar.gz
137+
name: structure_analysis
138138
description: structure analysis model for anybaseocr
139-
size: 31477056
139+
type: tarball
140+
path_in_archive: 'structure_analysis'
141+
size: 29002514
140142
- url: https://ocr-d-repo.scc.kit.edu/models/dfki/layoutAnalysis/mapping_densenet.pickle
141143
name: mapping_densenet.pickle
142144
description: mapping model for anybaseocr
143145
size: 374
144146
ocrd-anybaseocr-tiseg:
145-
- url: https://ocr-d-repo.scc.kit.edu/models/dfki/tiseg/seg_model.hdf5
146-
name: seg_model.hdf5
147+
- url: https://ocr-d.kba.cloud/seg_model.tar.gz
148+
name: seg_model
147149
description: text image segmentation model for anybaseocr
148-
size: 66080688
150+
type: tarball
151+
path_in_archive: 'seg_model'
152+
size: 61388872
149153
ocrd-kraken-segment:
150154
- url: https://github.com/mittagessen/kraken/raw/master/kraken/blla.mlmodel
151155
description: Pretrained baseline segmentation model

ocrd/ocrd/resource_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,17 @@ def download(
249249
else:
250250
self._copy_impl(url, fpath, progress_cb)
251251
elif resource_type == 'tarball':
252-
with pushd_popd(tempdir=True):
252+
with pushd_popd(tempdir=True) as tempdir:
253253
if is_url:
254254
self._download_impl(url, 'download.tar.xx', progress_cb, size)
255255
else:
256256
self._copy_impl(url, 'download.tar.xx', progress_cb)
257257
Path('out').mkdir()
258258
with pushd_popd('out'):
259-
log.info("Extracting tarball")
259+
log.info("Extracting tarball to %s/out" % tempdir)
260260
with open_tarfile('../download.tar.xx', 'r:*') as tar:
261261
tar.extractall()
262-
log.info("Copying '%s' from tarball to %s" % (path_in_archive, fpath))
262+
log.info("Copying '%s' from extracted tarball %s/out to %s" % (path_in_archive, tempdir, fpath))
263263
copytree(path_in_archive, str(fpath))
264264
# TODO
265265
# elif resource_type == 'github-dir':

0 commit comments

Comments
 (0)