Split-merge fixes on Windows

pull/1283/head
Piero Toffanin 2021-05-11 15:04:28 -04:00
rodzic 717b6dcb6e
commit d77de0ced4
3 zmienionych plików z 21 dodań i 4 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import rasterio
import fiona
import numpy as np
import math
import sys
from opendm import log
from opendm import io
from opendm import concurrency
@ -13,9 +14,15 @@ from opendm import system
from skimage.feature import canny
from skimage.draw import line
from skimage.graph import route_through_array
import shapely
from shapely.geometry import LineString, mapping, shape
from shapely.ops import polygonize, unary_union
if sys.platform == 'win32':
# Temporary fix for: ValueError: GEOSGeom_createLinearRing_r returned a NULL pointer
# https://github.com/Toblerity/Shapely/issues/1005
shapely.speedups.disable()
def write_raster(data, file):
profile = {
'driver': 'GTiff',
@ -71,6 +78,7 @@ def compute_cutline(orthophoto_file, crop_area_file, destination, max_concurrenc
if len(crop_f) == 0:
log.ODM_WARNING("Crop area is empty, cannot compute cutline")
return
crop_poly = shape(crop_f[1]['geometry'])
crop_f.close()

Wyświetl plik

@ -455,7 +455,16 @@ def get_submodel_argv(args, submodels_path = None, submodel_name = None):
read_json_always = ['cameras']
argv = sys.argv
result = [argv[0]] # Startup script (/path/to/run.py)
# Startup script (/path/to/run.py)
startup_script = argv[0]
# On Windows, make sure we always invoke the "run.bat" file
if sys.platform == 'win32':
startup_script_dir = os.path.dirname(startup_script)
startup_script = os.path.join(startup_script_dir, "run")
result = [startup_script]
args_dict = vars(args).copy()
set_keys = [k[:-len("_is_set")] for k in args_dict.keys() if k.endswith("_is_set")]

Wyświetl plik

@ -43,9 +43,9 @@ class ODMSplitStage(types.ODM_Stage):
log.ODM_INFO("Large dataset detected (%s photos) and split set at %s. Preparing split merge." % (len(photos), args.split))
config = [
"submodels_relpath: ../submodels/opensfm",
"submodel_relpath_template: ../submodels/submodel_%04d/opensfm",
"submodel_images_relpath_template: ../submodels/submodel_%04d/images",
"submodels_relpath: " + os.path.join("..", "submodels", "opensfm"),
"submodel_relpath_template: " + os.path.join("..", "submodels", "submodel_%04d", "opensfm"),
"submodel_images_relpath_template: " + os.path.join("..", "submodels", "submodel_%04d", "images"),
"submodel_size: %s" % args.split,
"submodel_overlap: %s" % args.split_overlap,
]