Add debug logging to DeepStack plugin for better monitoring and troubleshooting

This commit is contained in:
Sergey Krashevich 2023-04-23 18:31:13 +03:00
parent f02a9d6238
commit 2794cd0593
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -74,10 +74,13 @@ class DeepStack(DetectionApi):
detections = np.zeros((20, 6), np.float32)
for i, detection in enumerate(response_json["predictions"]):
logger.debug(f"Response: {detection}")
if detection["confidence"] < 0.4:
logger.debug(f"Break due to confidence < 0.4")
break
label = self.get_label_index(detection["label"])
if label < 0:
logger.debug(f"Break due to unknown label")
break
detections[i] = [
label,