diff --git a/luxonis_ml/data/datasets/luxonis_dataset.py b/luxonis_ml/data/datasets/luxonis_dataset.py index c92c70c4..ee7c8c28 100644 --- a/luxonis_ml/data/datasets/luxonis_dataset.py +++ b/luxonis_ml/data/datasets/luxonis_dataset.py @@ -310,6 +310,10 @@ def get_classes(self) -> Tuple[List[str], Dict[str, List[str]]]: for c in classes } ) + for task in self.metadata["classes"]: + self.metadata["classes"][task] = sorted( + self.metadata["classes"][task] + ) return sorted(all_classes), self.metadata["classes"] def set_skeletons( diff --git a/tests/test_data/test_dataset.py b/tests/test_data/test_dataset.py index f2c27d24..3935ecef 100644 --- a/tests/test_data/test_dataset.py +++ b/tests/test_data/test_dataset.py @@ -481,37 +481,39 @@ def generator(): "vehicle_segmentation", } assert dataset.get_classes()[1] == { - "boundingbox": ["motorbike", "car"], + "boundingbox": sorted(["motorbike", "car"]), "motorbike-boundingbox": ["motorbike"], "motorbike-keypoints": ["motorbike"], "car-boundingbox": ["car"], "car-keypoints": ["car"], "vehicle_type_segmentation": ["background", "car", "motorbike"], - "brand_segmentation": [ - "background", - "chrysler", - "bmw", - "ducati", - "dodge", - "ferrari", - "infiniti", - "land-rover", - "roll-royce", - "saab", - "Kawasaki", - "moto", - "truimph", - "alfa-romeo", - "harley", - "honda", - "jeep", - "aprilia", - "piaggio", - "yamaha", - "buick", - "pontiac", - "isuzu", - ], + "brand_segmentation": sorted( + [ + "background", + "chrysler", + "bmw", + "ducati", + "dodge", + "ferrari", + "infiniti", + "land-rover", + "roll-royce", + "saab", + "Kawasaki", + "moto", + "truimph", + "alfa-romeo", + "harley", + "honda", + "jeep", + "aprilia", + "piaggio", + "yamaha", + "buick", + "pontiac", + "isuzu", + ] + ), "color_segmentation": ["background", "blue", "green", "red"], "vehicle_segmentation": ["vehicle"], }