-
Notifications
You must be signed in to change notification settings - Fork 27
/
config.py
56 lines (48 loc) · 1.41 KB
/
config.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
import os
import sys
import numpy as np
from datasets import BP4D,DISFA
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(cur_dir, 'lib'))
class Config:
dataset = 'BP4D'
if dataset == 'BP4D':
dataset = BP4D()
else:
dataset = DISFA()
data_dir = dataset.dataset_path
num_AU_points = dataset.num_AU_points
output_dir = os.path.join(data_dir, 'output')
model_dir = os.path.join(output_dir, 'models')
vis_dir = os.path.join(output_dir, 'vis')
log_dir = os.path.join(output_dir, 'logs')
backbone = 'resnet50'
init_model = '/data0/resnet_v1_50.ckpt'
input_shape = (256,256)
output_shape = (input_shape[0]//4, input_shape[1]//4)
sigma = 2
pixel_means = np.array([[[123.68, 116.78, 103.94]]])
#learning rate setting
lr_dec_epoch = [5, 10]
lr = 5e-4
lr_dec_factor = 10
end_epoch = 10
optimizer = 'adam'
weight_decay = 1e-5
bn_train = True
batch_size = 16#16
test_batch_size = 1
multi_thread_enable = True
num_thread = 10
display = 1
def set_vis(self, vis=False):
self.vis = vis
def set_demo(self, demo=False):
self.demo = demo
cfg = Config()
if not os.path.exists(cfg.model_dir):
os.makedirs(cfg.model_dir)
if not os.path.exists(cfg.vis_dir):
os.makedirs(cfg.vis_dir)
if not os.path.exists(cfg.log_dir):
os.makedirs(cfg.log_dir)