forked from tykayn/mapillary_download
uncomment code
This commit is contained in:
parent
a87699a57c
commit
713856ebfc
40
download.py
40
download.py
@ -45,25 +45,25 @@ if __name__ == '__main__':
|
|||||||
if not os.path.exists('data/{}'.format(sequence_id)):
|
if not os.path.exists('data/{}'.format(sequence_id)):
|
||||||
os.makedirs('data/{}'.format(sequence_id))
|
os.makedirs('data/{}'.format(sequence_id))
|
||||||
|
|
||||||
# header = {'Authorization' : 'OAuth {}'.format(access_token)}
|
header = {'Authorization' : 'OAuth {}'.format(access_token)}
|
||||||
# url = 'https://graph.mapillary.com/image_ids?sequence_id={}'.format(sequence_id)
|
url = 'https://graph.mapillary.com/image_ids?sequence_id={}'.format(sequence_id)
|
||||||
# r = requests.get(url, headers=header)
|
r = requests.get(url, headers=header)
|
||||||
# data = r.json()
|
data = r.json()
|
||||||
|
|
||||||
# image_ids = data['data']
|
image_ids = data['data']
|
||||||
# img_num = len(image_ids)
|
img_num = len(image_ids)
|
||||||
# urls = []
|
urls = []
|
||||||
# print(img_num)
|
print(img_num)
|
||||||
# print('getting urls')
|
print('getting urls')
|
||||||
# for x in range(0, img_num):
|
for x in range(0, img_num):
|
||||||
# image_id = image_ids[x]['id']
|
image_id = image_ids[x]['id']
|
||||||
# req_url = 'https://graph.mapillary.com/{}?fields=thumb_2048_url'.format(image_id)
|
req_url = 'https://graph.mapillary.com/{}?fields=thumb_2048_url'.format(image_id)
|
||||||
# r = requests.get(req_url, headers=header)
|
r = requests.get(req_url, headers=header)
|
||||||
# data = r.json()
|
data = r.json()
|
||||||
# print('getting url {} of {}'.format(x, img_num))
|
print('getting url {} of {}'.format(x, img_num))
|
||||||
# urls.append(data['thumb_2048_url'])
|
urls.append(data['thumb_2048_url'])
|
||||||
|
|
||||||
# print('downloading.. this process will take a while. please wait')
|
print('downloading.. this process will take a while. please wait')
|
||||||
# for i,url in enumerate(urls):
|
for i,url in enumerate(urls):
|
||||||
# path = 'data/{}/{}.jpg'.format(sequence_id, i)
|
path = 'data/{}/{}.jpg'.format(sequence_id, i)
|
||||||
# download(url,path)
|
download(url,path)
|
||||||
|
Loading…
Reference in New Issue
Block a user