mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Added guard clause for empty inference reponse
This commit is contained in:
parent
cb57f79c43
commit
0ed16ed293
@ -88,9 +88,9 @@ class DGDetector(DetectionApi):
|
|||||||
logger.debug("Prediction generator was called")
|
logger.debug("Prediction generator was called")
|
||||||
with self.dg_model as model:
|
with self.dg_model as model:
|
||||||
while 1:
|
while 1:
|
||||||
logger.debug(f"q size before calling get: {self._queue.qsize()}")
|
logger.info(f"q size before calling get: {self._queue.qsize()}")
|
||||||
data = self._queue.get(block=True)
|
data = self._queue.get(block=True)
|
||||||
logger.debug(f"q size after calling get: {self._queue.qsize()}")
|
logger.info(f"q size after calling get: {self._queue.qsize()}")
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Data we're passing into model predict: {data}, shape of data: {data.shape}"
|
f"Data we're passing into model predict: {data}, shape of data: {data.shape}"
|
||||||
)
|
)
|
||||||
@ -113,7 +113,7 @@ class DGDetector(DetectionApi):
|
|||||||
res = next(self.prediction)
|
res = next(self.prediction)
|
||||||
|
|
||||||
# If we have an empty prediction, return immediately
|
# If we have an empty prediction, return immediately
|
||||||
if len(res.results[0]) == 0:
|
if len(res.results) == 0 or len(res.results[0]) == 0:
|
||||||
return detections
|
return detections
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user