OpenDroneMap-ODM/run.py

44 wiersze
1.0 KiB
Python
Czysty Zwykły widok Historia

#!/usr/bin/python
2015-08-27 12:59:35 +00:00
import sys
2015-11-20 10:00:43 +00:00
from opendm import log
from opendm import config
from opendm import system
from opendm.datatypes import ODMApp
2015-08-27 12:59:35 +00:00
2015-11-20 10:00:43 +00:00
def usage():
log.ODM_ERROR('USAGE: %s --images-src dataset_path' % sys.argv[0])
log.ODM_ERROR('OpenDroneMap app finished - %s' % system.now())
sys.exit(0)
if __name__ == '__main__':
2015-11-20 10:00:43 +00:00
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
2015-11-20 10:00:43 +00:00
# Force to provide the images path
if config.args.get('images_src') is None:
usage()
2015-11-20 10:00:43 +00:00
# Initialize odm app
# internally configure all tasks
app = ODMApp(config.args)
2015-11-20 10:00:43 +00:00
log.ODM_INFO('Runnning OpenDroneMap app - %s' % system.now())
2015-08-27 12:59:35 +00:00
2015-11-20 10:00:43 +00:00
# run single task
if config.args.get('run_only') is not None:
# task to run
tasks = config.args['run_only']
app.run_all(tasks, tasks)
2015-08-27 12:59:35 +00:00
2015-11-20 10:00:43 +00:00
# run multiple tasks
else:
# get initial and final tasks
initial_task = config.args['start_with']
final_task = config.args['end_with']
2015-08-27 12:59:35 +00:00
2015-11-20 10:00:43 +00:00
# run tasks
app.run_all(initial_task, final_task)
2015-08-27 12:59:35 +00:00
2015-11-20 10:00:43 +00:00
log.ODM_INFO('OpenDroneMap app finished - %s' % system.now())