Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix label comparison in voc format #1382

Merged
merged 6 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datumaro/datumaro/plugins/voc_format/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ def _load_categories(self, label_map_source=None):
label_map = OrderedDict()
label_map['background'] = [None, [], []]
for item in labels.items:
label_map[item.name] = [None, [], []]
label_map[self._strip_label(item.name)] = [None, [], []]

elif label_map_source in [LabelmapType.guess.name, None]:
elif label_map_source in {LabelmapType.guess.name, None}:
# generate colormap for union of VOC and input dataset labels
label_map = make_voc_label_map()

Expand Down
2 changes: 1 addition & 1 deletion datumaro/tests/test_voc_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def __iter__(self):

def categories(self):
label_cat = LabelCategories()
label_cat.add('label_1')
label_cat.add('Label_1')
label_cat.add('label_2')
return {
AnnotationType.label: label_cat,
Expand Down