From 7beeafc1ea3e6d4d57df6818dd66015023393ca3 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 16 Sep 2020 09:56:07 -0400 Subject: [PATCH] Limit masks to supported extensions --- opendm/context.py | 2 +- stages/dataset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opendm/context.py b/opendm/context.py index 5eeba38d..c188938f 100644 --- a/opendm/context.py +++ b/opendm/context.py @@ -51,7 +51,7 @@ odm_modules_src_path = os.path.join(root_path, "modules") settings_path = os.path.join(root_path, 'settings.yaml') # Define supported image extensions -supported_extensions = {'.jpg','.jpeg','.png', '.tif', '.tiff'} +supported_extensions = {'.jpg','.jpeg','.png', '.tif', '.tiff', '.bmp'} # Define the number of cores num_cores = multiprocessing.cpu_count() diff --git a/stages/dataset.py b/stages/dataset.py index 16262284..0c3ed086 100644 --- a/stages/dataset.py +++ b/stages/dataset.py @@ -99,7 +99,7 @@ class ODMLoadDatasetStage(types.ODM_Stage): masks = {} for r in rejects: (p, ext) = os.path.splitext(r) - if p[-5:] == "_mask": + if p[-5:] == "_mask" and ext.lower() in context.supported_extensions: masks[p] = r photos = []