2017-05-16 13:38:12 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import argparse
|
2018-02-05 17:46:59 +00:00
|
|
|
import logging
|
2017-05-16 13:38:12 +00:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
from opendm import context
|
|
|
|
|
2018-02-05 17:46:59 +00:00
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
|
|
|
|
level=logging.INFO)
|
|
|
|
|
2017-05-16 13:38:12 +00:00
|
|
|
|
|
|
|
def run_command(args):
|
|
|
|
result = subprocess.Popen(args).wait()
|
|
|
|
if result != 0:
|
2018-02-05 17:46:59 +00:00
|
|
|
logger.error("The command '{}' exited with return value {}". format(
|
|
|
|
' '.join(args), result))
|
2017-05-16 13:38:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
parser = argparse.ArgumentParser(description='Align metadaset submodels')
|
|
|
|
parser.add_argument('dataset',
|
|
|
|
help='path to the dataset to be processed')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
command = os.path.join(context.opensfm_path, 'bin', 'opensfm')
|
|
|
|
path = os.path.join(args.dataset, 'opensfm')
|
|
|
|
|
|
|
|
run_command([command, 'align_submodels', path])
|