monniert / docExtractor

(ICFHR 2020 oral) Code for "docExtractor: An off-the-shelf historical document element extraction" paper
https://www.tmonnier.com/docExtractor
MIT License
85 stars 10 forks source link

[bug] KeyError: 'filename' #4

Closed seekingdeep closed 3 years ago

seekingdeep commented 3 years ago

input.zip

(docExtractor) home@home-lnx:~/programs/docExtractor$ python src/via_converter.py --input_dir input/ --output_dir output/ --file ./test.json 
Traceback (most recent call last):
  File "src/via_converter.py", line 80, in <module>
    conv.run()
  File "src/via_converter.py", line 36, in run
    img = self.convert(annot)
  File "src/via_converter.py", line 41, in convert
    name = annot['filename']
KeyError: 'filename'
monniert commented 3 years ago

Thanks for the issue, depending on how you downloaded the json from VIA (as a full project json or simply downloading the via_region_data.json file) the structure is not the same, bcaf5c5 should handle both cases and fix this issue

seekingdeep commented 3 years ago

commit bcaf5c5 solves this issue, i confirm