fix(detection): add class name to detection data even if empty
Signed-off-by: Kader Miyanyedi <Kadermiyanyedi@hotmail.com>
This commit is contained in:
1 file changed
+3
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user