forked from tykayn/mapillary_download
fix metadata when camera_type is equirectangular
This commit is contained in:
parent
b410c1704d
commit
59933a7310
@ -26,7 +26,7 @@ def parse_args(argv =None):
|
||||
parser.add_argument('--destination', type=str, default='data', help='Path destination for the images')
|
||||
parser.add_argument('--image_limit', type=int, default=None, help='How many images you want to download')
|
||||
parser.add_argument('--overwrite', default=False, action='store_true', help='overwrite existing images')
|
||||
parser.add_argument("-v", "--version", action="version", version="release 1.1")
|
||||
parser.add_argument("-v", "--version", action="version", version="release 1.2")
|
||||
args = parser.parse_args(argv)
|
||||
if args.sequence_ids is None and args.image_ids is None:
|
||||
parser.error("Please enter at least one sequence id or image id")
|
||||
@ -45,6 +45,7 @@ def get_single_image_data(image_id, mly_header):
|
||||
req_url = 'https://graph.mapillary.com/{}?fields=thumb_original_url,altitude,camera_type,captured_at,compass_angle,geometry,exif_orientation,sequence'.format(image_id)
|
||||
r = session.get(req_url, headers=mly_header)
|
||||
data = r.json()
|
||||
#print(data)
|
||||
return data
|
||||
|
||||
|
||||
@ -152,7 +153,7 @@ if __name__ == '__main__':
|
||||
capture_time = datetime.utcfromtimestamp(int(image_data['captured_at'])/1000),
|
||||
longitude = image_data['geometry']['coordinates'][0],
|
||||
latitude = image_data['geometry']['coordinates'][1],
|
||||
picture_type = PictureType("equirectangular") if image_data['camera_type'] == 'spherical' else None,
|
||||
picture_type = PictureType("equirectangular") if image_data['camera_type'] == 'spherical' or image_data['camera_type'] == 'equirectangular' else None,
|
||||
direction = image_data['compass_angle'],
|
||||
altitude = image_data['altitude'],
|
||||
)
|
||||
@ -161,3 +162,4 @@ if __name__ == '__main__':
|
||||
print("{} already exists. Skipping ".format(path))
|
||||
continue
|
||||
executor.submit(download, url=image_data['thumb_original_url'], filepath=path, metadata=img_metadata)
|
||||
#download(url=image_data['thumb_original_url'], filepath=path, metadata=img_metadata)
|
||||
|
Loading…
Reference in New Issue
Block a user