Popsift check fix

pull/1383/head
Piero Toffanin 2021-12-17 12:12:41 -05:00
rodzic 497b5c60ae
commit 239f051940
2 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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")