diff --git a/opendm/gpu.py b/opendm/gpu.py index ae7d66f9..52fbc418 100644 --- a/opendm/gpu.py +++ b/opendm/gpu.py @@ -15,7 +15,10 @@ def has_popsift_and_can_handle_texsize(width, height): if not fits: log.ODM_WARNING("Image size (%sx%spx) would not fit in GPU memory, falling back to CPU" % (width, height)) return fits - except: + except (ModuleNotFoundError, ImportError): + return False + except Exception as e: + log.ODM_WARNING(str(e)) return False @lru_cache(maxsize=None) diff --git a/opendm/osfm.py b/opendm/osfm.py index f034eab7..c617988b 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -205,11 +205,11 @@ class OSFMContext: max_photo = find_largest_photo(photos) w, h = max_photo.width, max_photo.height if w > h: - h = (h / w) * feature_process_size - w = feature_process_size + h = int((h / w) * feature_process_size) + w = int(feature_process_size) else: - w = (w / h) * feature_process_size - h = feature_process_size + w = int((w / h) * feature_process_size) + h = int(feature_process_size) if has_popsift_and_can_handle_texsize(w, h) and feature_type == "SIFT": log.ODM_INFO("Using GPU for extracting SIFT features")