Skip to content

Commit

Permalink
Fix encoding issue (#11)
Browse files Browse the repository at this point in the history
Now supports all languages
Tested with korean input
  • Loading branch information
shashwat1998 authored Aug 21, 2020
1 parent fe8d4c9 commit bcf6e96
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ minivan
auto
truck
minibus
sedan
가각
2 changes: 1 addition & 1 deletion reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def get_xml_files(self):

@staticmethod
def get_classes(filename="classes.txt"):
with open(os.path.join(os.path.dirname(os.path.realpath('__file__')), filename), "r") as f:
with open(os.path.join(os.path.dirname(os.path.realpath('__file__')), filename), "r", encoding="utf8") as f:
lines = f.readlines()
return {value: key for (key, value) in enumerate(list(map(lambda x: x.strip(), lines)))}
2 changes: 1 addition & 1 deletion xml/image-0000016.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</size>
<segmented>0</segmented>
<object>
<name>sedan</name>
<name>가각</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
Expand Down
2 changes: 1 addition & 1 deletion xml/subdir/image-0000003.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</bndbox>
</object>
<object>
<name>sedan</name>
<name>가각</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
Expand Down

0 comments on commit bcf6e96

Please sign in to comment.