Cleanup bird classification (#17146)

* Cleanup bird classification

* Cleanup
This commit is contained in:
Nicolas Mowen 2025-03-14 07:21:50 -06:00 committed by GitHub
parent 759d963a04
commit fbd22c8124
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -781,14 +781,14 @@ def event_snapshot(
height=params.height, height=params.height,
quality=params.quality, quality=params.quality,
) )
except Exception as e: except Exception:
return JSONResponse( return JSONResponse(
content={"success": False, "message": f"Ongoing event not found: {e}"}, content={"success": False, "message": "Ongoing event not found"},
status_code=404, status_code=404,
) )
except Exception as e: except Exception:
return JSONResponse( return JSONResponse(
content={"success": False, "message": f"Unknown error occurred: {e}"}, content={"success": False, "message": "Unknown error occurred"},
status_code=404, status_code=404,
) )

View File

@ -115,10 +115,10 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):
x:x2, x:x2,
] ]
cv2.imwrite("/media/frigate/test_class.png", input) if input.shape != (224, 224):
input = cv2.resize(input, (224, 224))
input = np.expand_dims(input, axis=0) input = np.expand_dims(input, axis=0)
self.interpreter.set_tensor(self.tensor_input_details[0]["index"], input) self.interpreter.set_tensor(self.tensor_input_details[0]["index"], input)
self.interpreter.invoke() self.interpreter.invoke()
res: np.ndarray = self.interpreter.get_tensor( res: np.ndarray = self.interpreter.get_tensor(