Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: improve error handling in Deepstack detector #6463

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix error in parsing DeepStack response JSON and handle cases where p…
…redictions field is missing
  • Loading branch information
skrashevich committed May 11, 2023
commit bc38a93f731c3c232e98a423419aa3ddf5e2cff6
5 changes: 4 additions & 1 deletion frigate/detectors/plugins/deepstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ def detect_raw(self, tensor_input):
)
response_json = response.json()
detections = np.zeros((20, 6), np.float32)
if response_json.get("predictions") is None:
logger.debug(f"Error in parsing response json: {response_json}")
return detections

for i, detection in enumerate(response_json["predictions"]):
for i, detection in enumerate(response_json.get("predictions")):
logger.debug(f"Response: {detection}")
if detection["confidence"] < 0.4:
logger.debug(f"Break due to confidence < 0.4")
Expand Down