add try/catch for opensm pipeline

pull/249/head
edgarriba 2015-11-20 11:03:16 +00:00
rodzic bda020d43d
commit c65bf136f5
2 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -21,7 +21,7 @@ def load_dataset(images_dir, args):
files = [f for f in files if supported_extension(f)]
if len(files) < 1:
log.ODM_ERROR('Not found enough supported image in %s' % images_dir)
log.ODM_ERROR('Not found enough supported images in %s' % images_dir)
return
photos = []

Wyświetl plik

@ -8,9 +8,10 @@ def opensfm(project_path, args, photos):
log.ODM_INFO('Running Open Structure from Motion (OpenSfm)')
# check if we have input data
if photos is None:
if len(photos) == 0:
log.ODM_WARNING('Photos array is empty - Proceed to load images')
photos = dataset.load_dataset(project_path, args)
images_dir = dataset.join_paths(project_path, 'images/')
photos = dataset.load_dataset(images_dir, args)
# preconditions
if len(photos) < 1:
@ -21,16 +22,15 @@ def opensfm(project_path, args, photos):
working_dir = dataset.join_paths(project_path, 'opensfm')
system.mkdir_p(working_dir)
try:
# define opensfm execution command
cmd = dataset.join_paths(context.opensfm_path, 'bin/detect_features')
# run opensfm
#system.run('PYTHONPATH=%s %s %s' % (context.pyopencv_path, cmd, project_path))
#run('PYTHONPATH={} "{}/bin/run_all" opensfm'.format(PYOPENCV_PATH, OPENSFM_PATH))
system.run('PYTHONPATH=%s %s/bin/run_all %s' % \
(context.pyopencv_path, context.opensfm_path, images_dir))
except Exception, e:
log.ODM_ERROR(str(e))
return False
return True
def opensfm2():
print "\n - running OpenSfM - " + now()