2015-08-20 19:16:25 +00:00
|
|
|
#!/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
|
2016-07-18 22:02:37 +00:00
|
|
|
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 14:29:54 +00:00
|
|
|
|
2015-08-27 12:59:35 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
args = config.config()
|
|
|
|
|
2017-03-10 19:36:16 +00:00
|
|
|
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
|
2016-07-18 22:02:37 +00:00
|
|
|
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/")
|
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
# create an instance of my App BlackBox
|
|
|
|
# internally configure all tasks
|
2016-03-08 18:26:58 +00:00
|
|
|
app = ODMApp(args=args)
|
2015-11-16 22:18:53 +00:00
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
# create a plasm that only contains the BlackBox
|
|
|
|
plasm = ecto.Plasm()
|
|
|
|
plasm.insert(app)
|
2015-08-27 12:59:35 +00:00
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
# execute the plasm
|
|
|
|
plasm.execute(niter=1)
|
2015-08-27 12:59:35 +00:00
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
log.ODM_INFO('OpenDroneMap app finished - %s' % system.now())
|