-
Notifications
You must be signed in to change notification settings - Fork 1
/
init_params.py
71 lines (60 loc) · 1.97 KB
/
init_params.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
'''
This file initialize camera parameters and system settings.
All the parameters should be written in camera.ini
'''
import sys
sys.path.append('./PReNet')
import configparser
import numpy as np
config = configparser.ConfigParser()
#========= Camera 1 (cloud) Parameters============
config['cloud_camera']= {'focal_len': 20,
'ex_time': 1/250.,
'focus_dist': 50,
'f_num': 1.85,
'sensor_h': 2.8,
'threshold': 0.08,
'del_l': 50,
'streak_diameter': 10,
'resolution': 'Full-HD',
'fps': 1}
#========= Camera 2 (NC450) Parameters============
#source: https://www.tp-link.com/sg/home-networking/cloud-camera/nc450/#specifications
config['NC450']= {"focal_len":4,
'ex_time':1/60,
'sensor_h':6.35,
'f_num':3.6,
'focus_dist': 20,
'threshold':0.08,
'streak_diameter':10,
'del_l':50,
'fps':15,
'resolution':(1280,720)}
#========= Camera 3 (Jiang) Parameters ===========
config['Jiang']= {'focal_len': 4,
'ex_time': 1/250,
'sensor_h': 4.29,
'f_num':2.2,
'focus_dist':1.0,
'threshold':0.02,
'streak_diameter':10,
'del_l': 50,
'fps': 1,
'resolution': str(None)}
#========= classification configuration =========
config['classification']= {'model_path': 'D:\\CCTV\\rainfallcamera\\classification\\svm_model-4-grid_searched-200x200.joblib',
'patches': str((20,20)),
'window_size': str((10,10)),
'information': str(['contract', 'minimum brightness',
'sharpness', 'mean hue', 'mean saturation']),
}
#============== RNN configuration =================
config['PReNet']= {'model_path': 'D:\\CCTV\\rainfallcamera\\PReNet\\logs\\real\\PReNet1.pth',
'recurrent_iter': 4,
'logdir': 'D:\\CCTV\\rainfallcamera\\PReNet\\logs\\real',
'use_GPU': True,
'folder':str(20180401),
'gpu_id':str(0)}
# Write configuration file
with open('camera.ini', 'w') as f:
config.write(f)