kopia lustrzana https://github.com/OpenDroneMap/ODM
add main script
rodzic
c14cf7aa01
commit
c211ce2f1b
|
@ -1,44 +1,26 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import context
|
||||||
|
import system
|
||||||
|
|
||||||
|
from datatypes import ODMApp
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
objODMJob = prepare_objects()
|
|
||||||
|
|
||||||
os.chdir(objODMJob.jobDir)
|
print '[INFO] Initializing OpenDroneMap app - %s' % system.now()
|
||||||
|
|
||||||
dictSteps = {0:"resize", 1:"getKeypoints", 2:"match",
|
# Initialize odm app
|
||||||
3:"bundler", 4:"cmvs", 5:"pmvs", 6:"odm_meshing",
|
# internally configure all tasks
|
||||||
7:"odm_texturing", 8:"odm_georeferencing",
|
app = ODMApp(context.scripts_path)
|
||||||
9:"odm_orthophoto", 10:"zip_results"}
|
|
||||||
|
|
||||||
listJobQueue = []
|
|
||||||
intStart = -1
|
|
||||||
intEnd = -2
|
|
||||||
|
|
||||||
# Create a dict for holding our steps
|
|
||||||
# key is step number, val is call
|
|
||||||
# Construct the calls below in eval by iterating through the composed dict of steps
|
|
||||||
# --> Allows for running steps in any arbitray sequence, e.g. rebatching certain steps
|
|
||||||
for keys in dictSteps.keys():
|
|
||||||
if dictSteps[keys] == objODMJob.args.start_with:
|
|
||||||
intStart = keys
|
|
||||||
if dictSteps[keys] == objODMJob.args.end_with:
|
|
||||||
intEnd = keys
|
|
||||||
if intStart > intEnd:
|
|
||||||
sys.stdout.writelines("No Valid Steps - Exitting.")
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
for i in range(intStart,intEnd,1):
|
|
||||||
listJobQueue.append(dictSteps[i])
|
|
||||||
|
|
||||||
for steps in listJobQueue:
|
|
||||||
methodCall = steps+"()"
|
|
||||||
strEval = "objODMJob."+methodCall
|
|
||||||
# EVAL safety - *only* internally generated strings (no user strings)
|
|
||||||
eval(strEval)
|
|
||||||
|
|
||||||
if args.zip_results:
|
# set from where we want to start
|
||||||
print "\nCompressing results - " + now()
|
# by default we will start from the beginnig
|
||||||
run("cd " + jobOptions["jobDir"] + "-results/ && tar -czf " +
|
init_task_id = 0
|
||||||
jobOptions["jobDir"] + "-results.tar.gz *")
|
|
||||||
|
print '[INFO] Runnning OpenDroneMap app from state %s - %s' % (init_task_id, system.now())
|
||||||
|
|
||||||
|
# run all tasks
|
||||||
|
app.run(init_task_id)
|
||||||
|
|
||||||
|
|
||||||
print "\n - done - " + now()
|
print '[INFO] OpenDroneMap app finished - %s' % system.now()
|
Ładowanie…
Reference in New Issue