mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
Don't fail if deepstack detector times out (#8979)
This commit is contained in:
parent
e390533760
commit
c35c7da82a
@ -49,12 +49,18 @@ class DeepStack(DetectionApi):
|
||||
image.save(output, format="JPEG")
|
||||
image_bytes = output.getvalue()
|
||||
data = {"api_key": self.api_key}
|
||||
response = requests.post(
|
||||
self.api_url,
|
||||
data=data,
|
||||
files={"image": image_bytes},
|
||||
timeout=self.api_timeout,
|
||||
)
|
||||
|
||||
try:
|
||||
response = requests.post(
|
||||
self.api_url,
|
||||
data=data,
|
||||
files={"image": image_bytes},
|
||||
timeout=self.api_timeout,
|
||||
)
|
||||
except requests.exceptions.RequestException:
|
||||
logger.error("Error calling deepstack API")
|
||||
return np.zeros((20, 6), np.float32)
|
||||
|
||||
response_json = response.json()
|
||||
detections = np.zeros((20, 6), np.float32)
|
||||
if response_json.get("predictions") is None:
|
||||
|
Loading…
Reference in New Issue
Block a user