verbose = args.verbose auto_done = args.auto_done add_file_name = args.add_file_name make = args.make model = args.model # Retrieve/validate project key if not args.skip_validate_project: project_key = get_project_key(args.project, args.project_key) else: project_key = args.project_key or '' # Map orientation from degress to tags if orientation is not None: orientation = format_orientation(orientation) # Distance/Angle threshold for duplicate removal # NOTE: This might lead to removal of panorama sequences min_duplicate_distance = float(args.duplicate_distance) min_duplicate_angle = float(args.duplicate_angle) # Fetch authentication info try: MAPILLARY_USERNAME = args.user if args.user is not None else os.environ['MAPILLARY_USERNAME'] MAPILLARY_EMAIL = args.email if args.email is not None else os.environ['MAPILLARY_EMAIL'] MAPILLARY_USERKEY = args.userkey MAPILLARY_SECRET_HASH = os.environ.get('MAPILLARY_SECRET_HASH', None) secret_hash = None upload_token = None
parser.add_argument('--keep-timestamp', action='store_true', dest='timestamp', help='keep original timestamp of image file') parser.add_argument( '--backup', action='store_true', dest='backup', help='store backup of overwritten values in Mapillary JSON') args = parser.parse_args() if args.orientation is not None: exifOrientation = format_orientation(args.orientation) s = Sequence(args.path) if args.interpolate: bearings = s.interpolate_direction() for filename in s.get_file_list(args.path): stat = os.stat(filename) exifRead = EXIF(filename) mapillaryTag = json.loads(exifRead.extract_image_description()) if args.interpolate: bearing = bearings[filename] else: bearing = exifRead.extract_direction()