-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
89 lines (86 loc) · 3.49 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
""" Settings and defaults"""
SETTINGS = {
'org_id': 123456789876543,
'output_folder': 'outputs',
'image_downloads_folder': 'downloaded_images',
'image_detections_folder': 'images_with_detections',
'image_cropped_detections_folder': 'cropped_images',
'seq_out_file': 'seq_dataset.csv',
'img_out_file': 'img_dataset.csv',
'img_meta_out_file': 'img_meta_dataset.csv', # images with metadata
'detections_out_file': 'img_detections_dataset.csv', # detections of images
'token': 'MLY|1234567890123456|1234567890abcdef1234567890abcdef',
'min_zoom': 13,
'max_zoom': 14,
'AOI_bbox': {
# Define the lower left (ll) / upper right (ur) latitude and longitude
# The current values are defining a bounding box for Cyprus
'll_lat': 34.52,
'll_lon': 32.19,
'ur_lat': 35.49,
'ur_lon': 34.18,
},
'image_metadata_fields': [
'sequence',
'id',
'captured_at',
'compass_angle',
# 'computed_compass_angle', # doesn't exist for all, so removed it
'thumb_256_url',
# 'thumb_1024_url',
# 'thumb_2048_url',
'thumb_original_url',
'width', # use this as a sketchy way to derive camera make
'height', # we will also need the height for the coordinate normalization of detections
],
'image_detections_fields': [
'id',
'width', # use this as a sketchy way to derive camera make
'height', # we also use width and height for the detection coordinate normalization
'detections.id',
'detections.value',
'detections.geometry',
],
'detections_to_keep': [
'nature--terrain',
'nature--vegetation',
'nature--water',
'object--vehicle--car',
],
# Let's colour code the detections for better visualization
# This is in RGBA, and the last one is 128 for all, in order to be transparent
'detection_colours': {
'nature--terrain': (165,42,42,128), # brown
'nature--vegetation': (0,255,0,128), # green
'nature--water': (0,0,255,128), # blue
'object--vehicle--car': (255,255,0,128), # yellow
},
# All the detections we want to include in our mask
'detection_masks': {
'nature--terrain': 1,
'nature--vegetation': 2,
},
'graph_endpoint': 'https://graph.mapillary.com',
# How many images to request for simultaneously
# If requesting with GET, then better not increase this value to more than 50
'img_request_batch_size': 50,
# How many images to request detections for simultaneously
'img_detections_batch_size': 20,
# Potential quality values: 256, 1024, 2048, original
# Note that in order for a value to work (e.g. 256), it must be present in the
# images metadata csv. If it's not available, then the scripts should be run
# with the appropriate settings first.
'img_download_quality': 'original',
}
# If you want to have redacted settings (e.g., have your application token
# automatically applied without it being visible publicly), you can create
# locally a "redacted.py" file, which is already git-ignored. In that file
# (which is attempted to be sourced right below), you can override the
# SETTINGS values. The following 2 lines are examples:
# """redacted.py"""
# SETTINGS['org_id'] = 987654321
# SETTINGS['token'] = 'MLY|0123456789012345|01234567890abcdef01234567890abc'
try:
from redacted import *
except ImportError:
print("No redacted overrides found ...")