Skip to content

Commit

Permalink
add robust JSON handeling for auto annotation runner (cvat-ai#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoff authored and Chris Lee-Messer committed Mar 5, 2020
1 parent 1db9675 commit aa1a4b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/auto_annotation/run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def main():
return

with open(mapping_file) as json_file:
mapping = json.load(json_file)
try:
mapping = json.load(json_file)
except json.decoder.JSONDecodeError:
logging.critical('JSON file not able to be parsed! Check file')
return

try:
mapping = mapping['label_map']
Expand Down

0 comments on commit aa1a4b0

Please sign in to comment.