Skip to content

Commit

Permalink
fix(opendataset): fix the label generating style of VGGFace2
Browse files Browse the repository at this point in the history
PR Closed: #1201
  • Loading branch information
willandfree committed Feb 21, 2022
1 parent a3e79e2 commit 00aff52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tensorbay/opendataset/VGGFace2/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ def _get_classifications(
# ...
for line in islice(csv.reader(fp), 1, None):
# The normal format of each line of the file is
# '<class_id>,"<class_name>",<sample_num>,<flag>,<gender>,\n'
# '<class_id>, "<class_name>",<sample_num>,<flag>,<gender>,\n'
# but now there is an error type
# '<class_id>,"<class_,name>",<sample_num>,<flag>,<gender>\n'
# '<class_id>, "<class_,name>",<sample_num>,<flag>,<gender>\n'
if line[-1] != "":
# join the splitted "class_ and name"
line[1] = "".join(islice(line, 1, 3))
# Starting from the 4th element, each element moves forward one step
line.pop(2)
line[4] = line[4].rstrip("\n")
category_id = line[0]
category_name = line[1].strip('"')
category_name = line[1].strip(' "')
attributes = dict(
zip(
attribute_names,
Expand Down

0 comments on commit 00aff52

Please sign in to comment.