forked from OpenDroneMap/ODM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
49 lines (37 loc) · 1.54 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
from opendm import log
from opendm import config
from opendm import system
from opendm import io
import ecto
import os
from scripts.odm_app import ODMApp
if __name__ == '__main__':
args = config.config()
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
# Add project dir if doesn't exist
args.project_path = io.join_paths(args.project_path, args.name)
if not io.dir_exists(args.project_path):
log.ODM_WARNING('Directory %s does not exist. Creating it now.' % args.name)
system.mkdir_p(os.path.abspath(args.project_path))
# If user asks to rerun everything, delete all of the existing progress directories.
# TODO: Move this somewhere it's not hard-coded
if args.rerun_all:
log.ODM_DEBUG("Rerun all -- Removing old data")
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)
# execute the plasm
plasm.execute(niter=1)
log.ODM_INFO('OpenDroneMap app finished - %s' % system.now())