From f1fe8ddfc5e54916a556807c84ec6429219a8c0c Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 4 Jun 2019 11:00:25 +0200 Subject: [PATCH] Fixed if clause to catch empty list as well Signed-off-by: Jim Martens --- src/twomartens/masterthesis/data.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/twomartens/masterthesis/data.py b/src/twomartens/masterthesis/data.py index 609fb3c..03937ec 100644 --- a/src/twomartens/masterthesis/data.py +++ b/src/twomartens/masterthesis/data.py @@ -413,11 +413,9 @@ def prepare_scenenet_val(data_path: str, protobuf_path: str) -> Tuple[List[List[ instance_local[instance_local != instance_id] = 0 instance_local[instance_local == instance_id] = 1 coordinates = ndimage.find_objects(instance_local) - if coordinates is None: # the current instance was not in this frame + if coordinates is None or not coordinates: # the current instance was not in this frame continue else: - print(instance_local) - print(coordinates) coordinates = coordinates[0] # extract the coords of the one object x = coordinates[0]