From 3716ba708e96f8e4288e06e28f56bd19a4db5851 Mon Sep 17 00:00:00 2001 From: Jernej Sabadin Date: Wed, 27 Nov 2024 07:00:23 +0100 Subject: [PATCH] refactor conditional logic --- luxonis_ml/data/loaders/luxonis_loader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luxonis_ml/data/loaders/luxonis_loader.py b/luxonis_ml/data/loaders/luxonis_loader.py index 0c9b9e7e..44853a9c 100644 --- a/luxonis_ml/data/loaders/luxonis_loader.py +++ b/luxonis_ml/data/loaders/luxonis_loader.py @@ -330,11 +330,11 @@ def _load_image_with_annotations( (len(self.class_mappings[task]), height, width), dtype=np.uint8, ) - if task == LabelType.BOUNDINGBOX: + elif task == LabelType.BOUNDINGBOX: empty_array = np.zeros((0, 6), dtype=np.float32) - if task == LabelType.KEYPOINTS: + elif task == LabelType.KEYPOINTS: empty_array = np.zeros((0, 3), dtype=np.float32) - if task == LabelType.CLASSIFICATION: + elif task == LabelType.CLASSIFICATION: empty_array = np.zeros( (0, len(self.class_mappings[task])), dtype=np.float32 )