-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.py
More file actions
125 lines (116 loc) · 11.9 KB
/
install.py
File metadata and controls
125 lines (116 loc) · 11.9 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
"""
This Python script is used to install the MORICHI dataset from the 4TU.ResearchData repository.
Delft University of Technology
Dr. Miguel Martin
"""
import os
import urllib.request
import zipfile
def install_morichi_dataset():
INSTALL_DIR = os.getcwd()
user_input = input("Do you want to install the MORICHI dataset in the directory " + INSTALL_DIR + " (y/n):")
if user_input == "y":
## Create MORICHI folder
os.makedirs('MORICHI', exist_ok=True)
## Download README.txt
if not os.path.isfile(os.path.join('MORICHI', 'README.txt')):
print('Downloading README.txt ...')
urllib.request.urlretrieve('https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/84badad7-02ed-4052-9bf7-1c98b7d3c1b2', os.path.join('MORICHI', 'README.txt'))
## Download and uncompressed the MO folder
if not os.path.isdir(os.path.join('MORICHI', 'MO')):
print('Downloading MO.zip ...')
urllib.request.urlretrieve('https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/a00e115d-2b5f-4511-8b07-f6bcb9c2e9b8', os.path.join('MORICHI', 'MO.zip'))
print('Extracting MO.zip ...')
with zipfile.ZipFile(os.path.join('MORICHI', 'MO.zip')) as zip_ref:
zip_ref.extractall('MORICHI')
os.remove(os.path.join('MORICHI', 'MO.zip'))
## Create RI folder
os.makedirs(os.path.join('MORICHI', 'RI'), exist_ok=True)
## Download and uncompressed (if necessary) all remaining files in RI folder
files_dict = {
'analysis_thermal_images.csv' : 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/3a730e67-00b7-4d28-be58-afb6f146a0b4',
'Analyze_thermal_images_using_python.ipynb': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/93f7d67b-05ca-4d33-bc51-d6bab701cb4f',
'contact_sensor_radiometric_values.csv' : 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/d69774ba-a87d-4d0b-8185-0c01fff45ddd',
'Fig1.png': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7343fb6a-61cf-4952-9552-abff3b3a8f06',
'GT.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7306c640-3b2e-4376-9a75-23f7320700fa',
'regions.png': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/c45306fd-63ce-41ad-80ad-046d320e8fe2',
'Technical_validation.ipynb': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/5f262836-e1d8-4f21-825d-d1cd8d5f2960',
'technical_validation.png': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/f3205810-7c45-4280-adaa-2e787682a0d7',
'TIR_ANALYSIS_2024_08_08_06_18_20_PM.json': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/f5420808-66c2-4590-966e-849fa823b36f',
'TIR_ANALYSIS_2024_08_08_06_18_20_PM.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/f945e8f9-f884-431a-9c55-61da8b64a6e9',
'TIR_ANALYSIS_2024_08_08_06_46_37_PM.json': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/3196cc8e-0558-4747-b88b-2b0522260a20',
'TIR_ANALYSIS_2024_08_08_06_46_37_PM.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/f3c8f5d3-efb3-4611-82cb-a271deeac39e',
'TIR_SNAPSHOT_2024_08_08_06_18_20_PM.jpg': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/4c685358-0a96-4d2d-b273-d12dab582325',
'TIR_SNAPSHOT_2024_08_08_06_46_37_PM.jpg': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/41d257d8-a238-4c54-92fd-50cff5a83ad0',
'TIR_TECHNICAL_VALIDATION_2024_08_08_06_18_20_PM.json': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/679a4445-51bf-4a11-8634-55c64674f76d',
'TIR_TECHNICAL_VALIDATION_2024_08_08_06_18_20_PM.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/1be0116e-edc6-4f40-b07d-dcc4ee566ffd',
'TIR_TECHNICAL_VALIDATION_2024_08_08_06_46_37_PM.json': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/c30b877d-de4e-44b9-819d-3528b7961b61',
'TIR_TECHNICAL_VALIDATION_2024_08_08_06_46_37_PM.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/f07a5eba-dc89-4ae2-b145-759b8ed97ea0',
'TIR_2024_07_26.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/9f6ab49d-39eb-4d1f-aa23-5f7da9f19e51',
'TIR_2024_07_30.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/29bc263d-3ce5-4293-8ab6-d4507272b056',
'TIR_2024_07_31.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/bd9b2be0-7d0d-4308-80f8-8b12efdcc675',
'TIR_2024_08_01.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/86bf763c-1a10-45d9-8a8b-63114ded09c2',
'TIR_2024_08_02.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/56a272c9-cf8c-4303-ab34-3489ae3a7211',
'TIR_2024_08_03.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/4100bd91-ea7c-4815-8865-6dd7d6380fbb',
'TIR_2024_08_04.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7630c40e-de83-4733-90e3-deb571287717',
'TIR_2024_08_05.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/52303865-9750-4bbb-a7e1-1c5eb4751b6b',
'TIR_2024_08_06.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/2667491a-efac-412e-9cde-36bb5b2fd155',
'TIR_2024_08_07.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/ecf073a7-3c23-44bb-a296-d97c6aca0dce',
'TIR_2024_08_08.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/8ca8ebe4-a308-48dc-aeb9-753d123ecf3b',
'TIR_2024_08_09.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/a552aa83-7ce2-43bf-8721-83018bb39bd4',
'TIR_2024_08_10.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/2d964373-197f-4c89-b718-a73d2d602a14',
'TIR_2024_08_11.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7e2eab67-ecc1-411b-9e81-2574ad7cce39',
'TIR_2024_08_12.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/ebbef779-5113-4c6c-b11d-c49bb5efdeec',
'TIR_2024_08_13.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/866dd1c1-bccf-4ecf-8314-f7c819cfb920',
'TIR_2024_08_14.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/e3bb8c14-8f83-404c-a8da-ed594e542c8f',
'TIR_2024_08_15.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/9826037e-21cb-45e8-8ecd-c0781ab6794b',
'TIR_2024_08_16.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/6e204490-5a46-4f47-9ae3-55b1dc370051',
'TIR_2024_08_17.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/abdb6800-07f2-473b-b3d1-020308bc5723',
'TIR_2024_08_18.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/bac18c85-7638-4c62-b6f8-178080e08a43',
'TIR_2024_08_19.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/a8e04fd6-eb90-4539-8466-9f53a960897a',
'TIR_2024_08_20.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/c5d521f0-b9c9-47cc-99ae-5baee035d38f',
'TIR_2024_08_21.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/931ded62-3e03-4fbe-9650-902121890238',
'TIR_2024_08_22.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/6c10ded9-4bbc-4af9-a256-fbf897d78b1e',
'TIR_2024_08_23.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/55f8ba70-bf71-40b4-8886-88b6ef05c0ba',
'TIR_2024_08_24.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/c74734bd-fb78-4344-b49c-227c0d73de7b',
'TIR_2024_08_25.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/96075c55-1412-4f93-bf73-553ab25f7cbc',
'TIR_2024_08_26.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/9663f786-c23f-433a-83ba-c67126d92c8e',
'TIR_2024_08_27.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/25a9f51a-753a-431f-9140-aed424ef8210',
'TIR_2024_08_28.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7d85202d-cd6e-440f-b5d4-00a36b1ffe66',
'TIR_2024_08_29.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/7e17df52-ec0e-4456-942d-3d125806aaef',
'TIR_2024_08_30.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/9d499c60-de26-4904-94aa-3ed24e00fe38',
'TIR_2024_08_31.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/35f00c6d-7d5c-4a68-ad95-3452ebe93d1d',
'TIR_2024_09_01.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/fb928ca0-09be-4638-b9f0-a9b9ada11592',
'TIR_2024_09_02.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/dd13e496-0e9a-4f93-9b71-9f021c3f6621',
'TIR_2024_09_03.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/665dc1a8-aeca-431c-a6cf-884db1177de8',
'TIR_2024_09_04.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/56229583-3909-4623-babf-3c6dfa908072',
'TIR_2024_09_05.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/6e35b70a-8fda-4adf-8d5b-07e88f5fdb22',
'TIR_2024_09_06.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/ce737856-edec-47ce-83a6-8893a8bab170',
'TIR_2024_09_07.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/e8a9b3f2-693d-492c-8bb6-b2a0c8cfde70',
'TIR_2024_09_08.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/eda72659-1478-4fa4-bcc8-c2faaee76ce6',
'TIR_2024_09_09.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/2de18cef-c5cc-4049-bc3c-5866b8cb77e0',
'TIR_2024_09_10.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/71b87a28-4e73-4492-be87-369274108de1',
'TIR_2024_09_11.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/2b9a13a6-3d0f-4114-8bf4-6df3fdf4b43f',
'TIR_2024_09_15.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/a2cd7313-c0f2-445a-845f-90ecfb1e3619',
'TIR_2024_09_16.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/23ae9831-f028-493b-88e3-5bc84a44c359',
'TIR_2024_09_17.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/39c9ed26-386e-4f6f-b8da-7bf7defd4565',
'TIR_2024_09_18.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/770dea8f-58dd-4a9b-b0c4-84738cc1071b',
'TIR_2024_09_19.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/cb5a94c8-0aa3-4b68-99c1-4bc00088175a',
'TIR_2024_09_20.zip': 'https://data.4tu.nl/file/c5fb8062-af5d-491a-8faf-8be7fc390f48/9b37a822-3d5f-46db-8201-b118cc83ead3'
}
for f in files_dict.keys():
if f.endswith('.zip'):
fn, ext = os.path.splitext(os.path.basename(f))
if not os.path.isdir(os.path.join('MORICHI', 'RI', fn)):
print('Downloading ' + f + ' ...')
urllib.request.urlretrieve(files_dict[f], os.path.join('MORICHI', 'RI', f))
print('Extracting ' + f + ' ...')
with zipfile.ZipFile(os.path.join('MORICHI', 'RI', f)) as zip_ref:
zip_ref.extractall(os.path.join('MORICHI', 'RI'))
os.remove(os.path.join('MORICHI', 'RI', f))
else:
if not os.path.isfile(os.path.join('MORICHI', 'RI', f)):
print('Downloading ' + f + ' ...')
urllib.request.urlretrieve(files_dict[f], os.path.join('MORICHI', 'RI', f))
if __name__ == '__main__':
install_morichi_dataset()