Fixed if clause to catch empty list as well

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-06-04 11:00:25 +02:00
parent d370604279
commit f1fe8ddfc5

View File

@ -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]