From 06a7a75b603c9365713e331dd7d650a09d64cef2 Mon Sep 17 00:00:00 2001 From: Stefal Date: Tue, 19 Sep 2023 22:03:33 +0200 Subject: [PATCH] check sequence content --- download.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/download.py b/download.py index fbf9c33..cdf3429 100644 --- a/download.py +++ b/download.py @@ -73,6 +73,9 @@ def get_image_data_from_sequences__future(sequences_id, mly_header): url = 'https://graph.mapillary.com/image_ids?sequence_id={}'.format(sequence_id) r = requests.get(url, headers=header) data = r.json() + if data.get('data') == []: + print("Empty or wrong sequence {} of {} - id : {}".format(i+1, len(sequences_id), sequence_id)) + continue image_ids = data['data'] total_image = len(image_ids) print("{} images in sequence {} of {} - id : {}".format(total_image, i+1, len(sequences_id), sequence_id))