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
|
2015-08-27 12:59:35 +00:00
|
|
|
|
|
|
|
import sys
|
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
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
|
2015-11-20 10:00:43 +00:00
|
|
|
def usage():
|
2016-02-26 18:50:12 +00:00
|
|
|
log.ODM_ERROR('USAGE: %s --project-path [project_path]' % sys.argv[0])
|
|
|
|
log.ODM_ERROR('OpenDroneMap app finished - %s' % system.now())
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
2015-08-27 12:59:35 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
|
2015-08-27 17:03:38 +00:00
|
|
|
|
2016-03-08 18:26:58 +00:00
|
|
|
args = config.config()
|
|
|
|
|
2016-02-26 18:50:12 +00:00
|
|
|
# Force to provide the images path
|
2016-03-08 18:26:58 +00:00
|
|
|
if args.project_path is None:
|
2016-02-26 18:50:12 +00:00
|
|
|
usage()
|
2015-08-27 12:59:35 +00:00
|
|
|
|
2016-07-18 22:23:34 +00:00
|
|
|
#If user asks to rerun everything, delete all of the existing progress directories.
|
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())
|