fix(detection): add class name to detection data even if empty

Signed-off-by: Kader Miyanyedi <Kadermiyanyedi@hotmail.com>
This commit is contained in:
Kader Miyanyedi committed 2024-02-14 23:36:48 +03:00
1 parent 6b16970d50
commit 75bb07078c
1 file changed
+3 -1
+3 -1
View File
@@ -487,7 +487,9 @@ class Detections:
)
if np.asarray(xyxy).shape[0] == 0:
return cls.empty()
empty_detection = cls.empty()
empty_detection.data = {CLASS_NAME_DATA_FIELD: np.empty(0)}
return empty_detection
return cls(
xyxy=xyxy,