Skip to content

Commit

Permalink
bug fix for PPOCRLabel.exportJSON NameError: name 'null' is not defin…
Browse files Browse the repository at this point in the history
…ed (#31)

* bug fix for PPOCRLabel.exportJSON NameError: name 'null' is not defined

* fix code style

---------

Co-authored-by: ZERTIAN <zerui.tian@mercedes-benz.com>
  • Loading branch information
pinnnkman and ZERTIAN authored Jul 15, 2024
1 parent bcf632a commit 64b555f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,7 @@ def exportJSON(self):
if label:
label = label.replace("false", "False")
label = label.replace("true", "True")
label = label.replace("null", "None")
labeldict[file] = eval(label)
else:
labeldict[file] = []
Expand Down Expand Up @@ -3182,6 +3183,7 @@ def loadLabelFile(self, labelpath):
if label:
label = label.replace("false", "False")
label = label.replace("true", "True")
label = label.replace("null", "None")
labeldict[file] = eval(label)
else:
labeldict[file] = []
Expand Down

0 comments on commit 64b555f

Please sign in to comment.