OpenDroneMap-ODM/run.py

49 wiersze
1.5 KiB
Python
Czysty Zwykły widok Historia

#!/usr/bin/python
2015-12-22 12:29:13 +00:00
from opendm import log
from opendm import config
from opendm import system
2016-12-20 16:14:52 +00:00
from opendm import io
2015-08-27 12:59:35 +00:00
2015-11-26 12:15:02 +00:00
import ecto
import os
2015-08-27 12:59:35 +00:00
2015-11-26 12:15:02 +00:00
from scripts.odm_app import ODMApp
2015-08-27 12:59:35 +00:00
if __name__ == '__main__':
args = config.config()
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
2017-02-09 23:57:24 +00:00
2017-03-27 19:41:51 +00:00
# Add project dir if doesn't exist
2017-03-07 19:58:40 +00:00
args.project_path = io.join_paths(args.project_path, args.name)
if not io.dir_exists(args.project_path):
2017-02-09 23:57:24 +00:00
log.ODM_WARNING('Directory %s does not exist. Creating it now.' % args.name)
2016-12-20 16:14:52 +00:00
system.mkdir_p(os.path.abspath(args.project_path))
2015-08-27 12:59:35 +00:00
2017-03-27 19:41:51 +00:00
# If user asks to rerun everything, delete all of the existing progress directories.
2016-12-14 18:30:44 +00:00
# TODO: Move this somewhere it's not hard-coded
if args.rerun_all:
os.system("rm -rf "
+ args.project_path + "images_resize/ "
+ args.project_path + "odm_georeferencing/ "
+ args.project_path + "odm_meshing/ "
+ args.project_path + "odm_orthophoto/ "
+ args.project_path + "odm_texturing/ "
+ args.project_path + "opensfm/ "
+ args.project_path + "pmvs/")
# create an instance of my App BlackBox
# internally configure all tasks
app = ODMApp(args=args)
# create a plasm that only contains the BlackBox
plasm = ecto.Plasm()
plasm.insert(app)
2015-08-27 12:59:35 +00:00
# execute the plasm
plasm.execute(niter=1)
2015-08-27 12:59:35 +00:00
log.ODM_INFO('OpenDroneMap app finished - %s' % system.now())