From b49087f4150606dae545951a7b38b276098aff00 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 29 Aug 2019 15:43:08 +0200 Subject: [PATCH] Added yet another empty check Signed-off-by: Jim Martens --- src/twomartens/masterthesis/ssd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/twomartens/masterthesis/ssd.py b/src/twomartens/masterthesis/ssd.py index 4d5b627..07dfc57 100644 --- a/src/twomartens/masterthesis/ssd.py +++ b/src/twomartens/masterthesis/ssd.py @@ -541,6 +541,8 @@ def _get_observations(detections: Sequence[np.ndarray]) -> List[np.ndarray]: observations[i].append(observation_mean) final_observations.append(np.asarray(observations[i])) + if not len(observations[i]): + continue final_observations[i][:, -1] = -np.sum(final_observations[i][:, :-5] * np.log(final_observations[i][:, :-5]), axis=-1)