Fixing empty dataset

This commit is contained in:
hardik 2023-07-13 20:19:55 +02:00
parent abbde887dc
commit bfe058c307
1 changed files with 5 additions and 3 deletions

View File

@ -83,9 +83,11 @@ def map_detections_class_id(
)
detections_copy = copy.deepcopy(detections)
detections_copy.class_id = np.vectorize(source_to_target_mapping.get)(
detections_copy.class_id
)
if len(detections) > 0:
detections_copy.class_id = np.vectorize(source_to_target_mapping.get)(
detections_copy.class_id
)
return detections_copy