Add some documentation

This commit is contained in:
Stefal 2023-09-20 22:10:06 +02:00
parent 05f6ff2acf
commit 744212971d
5 changed files with 23 additions and 0 deletions

View file

@ -40,12 +40,14 @@ def download(url, filepath, metadata=None):
f.write(image)
print("{} downloaded".format(filepath))
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()
return data
def get_image_data_from_sequences(sequences_id, mly_header):
for i,sequence_id in enumerate(sequences_id):
url = 'https://graph.mapillary.com/image_ids?sequence_id={}'.format(sequence_id)
@ -61,6 +63,7 @@ def get_image_data_from_sequences(sequences_id, mly_header):
image_data['sequence_id'] = sequence_id
yield image_data
def get_image_data_from_sequences__future(sequences_id, mly_header):
for i,sequence_id in enumerate(sequences_id):
url = 'https://graph.mapillary.com/image_ids?sequence_id={}'.format(sequence_id)
@ -86,6 +89,7 @@ def get_image_data_from_sequences__future(sequences_id, mly_header):
#print(image_data)
yield image_data
def write_exif(picture, img_metadata):
'''
Write exif metadata
@ -103,6 +107,7 @@ def write_exif(picture, img_metadata):
return updated_image
if __name__ == '__main__':
args = parse_args()