def perform_work(): """Prepares for and runs the ODM code """ print("[worker] Starting") arg_file = os.environ.get('ODM_SETTINGS') project_path = os.environ.get('ODM_PROJECT') if not project_path: print("[worker] raising missing environment variable ODM_PROJECT") raise ValueError("Missing project path environment variable") print("[worker] settings file: " + str(arg_file)) new_settings = None print("[worker] loading settings") if arg_file: with open(arg_file, encoding='utf-8') as in_f: new_settings = yaml.safe_load(in_f) print("[worker] getting config using our settings: %s" % context.settings_path) args = config.config() print("[worker] merging config") if new_settings: for name in new_settings: if name not in NO_OVERRIDE_SETTINGS: setattr(args, name, new_settings[name]) print("[worker] config %s" % str(args)) print("[worker] setting project path") args.project_path = project_path os.chdir(project_path) print("[worker] Starting") app = ODMApp(args=args) app.execute() print("[worker] finishing")
log.ODM_INFO("Rerun all -- Removing old data") os.system("rm -rf " + " ".join([ quote(os.path.join(args.project_path, "odm_georeferencing")), quote(os.path.join(args.project_path, "odm_meshing")), quote(os.path.join(args.project_path, "odm_orthophoto")), quote(os.path.join(args.project_path, "odm_texturing")), quote(os.path.join(args.project_path, "opensfm")), quote(os.path.join(args.project_path, "odm_filterpoints")), quote(os.path.join(args.project_path, "odm_25dmeshing")), quote(os.path.join(args.project_path, "odm_25dtexturing")), quote(os.path.join(args.project_path, "mve")), quote(os.path.join(args.project_path, "submodels")), ])) app = ODMApp(args) app.execute() # Do not show ASCII art for local submodels runs if not "submodels/submodel_" in args.project_path: log.ODM_INFO( 'MMMMMMMMMMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMMMMMM') log.ODM_INFO( 'MMMMMMdo:..---../sNMMMMMMMMMMMMMMMMMMMMMMMMMMNs/..---..:odMMMMMM') log.ODM_INFO( 'MMMMy-.odNMMMMMNy/`/mMMMMMMMMMMMMMMMMMMMMMMm/`/hNMMMMMNdo.-yMMMM') log.ODM_INFO( 'MMN/`sMMMMMMMMMNNMm/`yMMMMMMMMMMMMMMMMMMMMy`/mMNNMMMMMMMMNs`/MMM') log.ODM_INFO( 'MM/ hMMMMMMMMNs.+MMM/ dMMMMMMMMMMMMMMMMMMh +MMM+.sNMMMMMMMMh +MM') log.ODM_INFO( 'MN /MMMMMMNo/./mMMMMN :MMMMMMMMMMMMMMMMMM: NMMMMm/./oNMMMMMM: NM')
# If user asks to rerun everything, delete all of the existing progress directories. if args.rerun_all: log.ODM_INFO("Rerun all -- Removing old data") os.system("rm -rf " + " ".join([ double_quote(os.path.join(args.project_path, p)) for p in get_processing_results_paths() ] + [ double_quote(os.path.join(args.project_path, "odm_meshing")), double_quote(os.path.join(args.project_path, "opensfm")), double_quote(os.path.join(args.project_path, "odm_texturing_25d")), double_quote(os.path.join(args.project_path, "odm_filterpoints")), double_quote(os.path.join(args.project_path, "submodels")), ])) app = ODMApp(args) retcode = app.execute() # Do not show ASCII art for local submodels runs if retcode == 0 and not "submodels/submodel_" in args.project_path: log.ODM_INFO( 'MMMMMMMMMMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMMMMMM') log.ODM_INFO( 'MMMMMMdo:..---../sNMMMMMMMMMMMMMMMMMMMMMMMMMMNs/..---..:odMMMMMM') log.ODM_INFO( 'MMMMy-.odNMMMMMNy/`/mMMMMMMMMMMMMMMMMMMMMMMm/`/hNMMMMMNdo.-yMMMM') log.ODM_INFO( 'MMN/`sMMMMMMMMMNNMm/`yMMMMMMMMMMMMMMMMMMMMy`/mMNNMMMMMMMMNs`/MMM') log.ODM_INFO( 'MM/ hMMMMMMMMNs.+MMM/ dMMMMMMMMMMMMMMMMMMh +MMM+.sNMMMMMMMMh +MM') log.ODM_INFO( 'MN /MMMMMMNo/./mMMMMN :MMMMMMMMMMMMMMMMMM: NMMMMm/./oNMMMMMM: NM')