Skip to content

Commit 0297376

Browse files
committed
Use space separation instead of underscore separation for renaming like other fiftyone imagenet class names
1 parent 6f24e9c commit 0297376

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

luxonis_ml/data/parsers/fiftyone_classification_parser.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def clean_imagenet_annotations(labels_path: Path) -> Path:
163163
This function handles two known issues in ImageNet FiftyOne exports:
164164
165165
1. Duplicate class names: First instance of "crane" is renamed
166-
to "crane_bird", second instance of "maillot" is renamed to
167-
"maillot_swim_suit".
166+
to "crane bird", second instance of "maillot" is renamed to
167+
"maillot swim suit".
168168
169169
2. Misindexed labels: "006742" label 517 is corrected to 134,
170170
"031933" label 639 is corrected to 638.
@@ -183,24 +183,24 @@ def clean_imagenet_annotations(labels_path: Path) -> Path:
183183
modified = False
184184

185185
# Fix duplicate class names
186-
# First "crane" (bird) should be renamed to "crane_bird"
186+
# First "crane" (bird) should be renamed to "crane bird"
187187
crane_indices = [i for i, c in enumerate(classes) if c == "crane"]
188188
if len(crane_indices) >= 1:
189189
first_crane_idx = crane_indices[0]
190190
classes[first_crane_idx] = "crane_bird"
191191
logger.info(
192-
f"Renamed class 'crane' at index {first_crane_idx} to 'crane_bird'"
192+
f"Renamed class 'crane' at index {first_crane_idx} to 'crane bird'"
193193
)
194194
modified = True
195195

196-
# Second "maillot" should be renamed to "maillot_swim_suit"
196+
# Second "maillot" should be renamed to "maillot swim suit"
197197
maillot_indices = [i for i, c in enumerate(classes) if c == "maillot"]
198198
if len(maillot_indices) >= 2:
199199
second_maillot_idx = maillot_indices[1]
200200
classes[second_maillot_idx] = "maillot_swim_suit"
201201
logger.info(
202202
f"Renamed class 'maillot' at index {second_maillot_idx} "
203-
"to 'maillot_swim_suit'"
203+
"to 'maillot swim suit'"
204204
)
205205
modified = True
206206

0 commit comments

Comments
 (0)