Skip to content

Commit ba935c8

Browse files
committed
fix pydoctor and typecheck
1 parent 8ce757c commit ba935c8

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

luxonis_ml/data/datasets/base_dataset.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,27 @@ def get_classes(self) -> dict[str, list[str]]:
109109
"""
110110
...
111111

112+
@abstractmethod
113+
def set_native_classes(
114+
self,
115+
native_classes: dict[int, str],
116+
source_format: str,
117+
) -> None:
118+
"""Sets the native class indexing from the original dataset
119+
format.
120+
121+
This stores the mapping from original dataset indices to class
122+
names.
123+
124+
@type native_classes: Dict[int, str]
125+
@param native_classes: A dictionary mapping original dataset
126+
indices to class names.
127+
@type source_format: str
128+
@param source_format: The name of the source format (e.g.,
129+
"coco", "imagenet").
130+
"""
131+
...
132+
112133
@abstractmethod
113134
def set_skeletons(
114135
self,

luxonis_ml/data/parsers/fiftyone_classification_parser.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,17 @@ def clean_imagenet_annotations(labels_path: Path) -> Path:
164164
165165
This function handles two known issues in ImageNet FiftyOne exports:
166166
167-
1. Duplicate class names:
168-
- First instance of "crane" -> "crane_bird"
169-
- Second instance of "maillot" -> "maillot_swim_suit"
167+
1. Duplicate class names: First instance of "crane" is renamed
168+
to "crane_bird", second instance of "maillot" is renamed to
169+
"maillot_swim_suit".
170170
171-
2. Misindexed labels:
172-
- "006742": 517 -> "006742": 134
173-
- "031933": 639 -> "031933": 638
171+
2. Misindexed labels: "006742" label 517 is corrected to 134,
172+
"031933" label 639 is corrected to 638.
173+
174+
@type labels_path: Path
175+
@param labels_path: Path to the labels.json file.
176+
@rtype: Path
177+
@return: Path to the cleaned labels file.
174178
"""
175179
with open(labels_path) as f:
176180
labels_data = json.load(f)

0 commit comments

Comments
 (0)