-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.py
61 lines (57 loc) · 1.99 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
57
58
59
60
61
import numpy as np
import os
class Config(object):
def __init__(self, args):
self.lr = eval(args.lr)
self.lr_str = args.lr
self.num_iters = len(self.lr)
self.num_classes = 20
self.modal = args.modal
if self.modal == 'all':
self.len_feature = 2048
else:
self.len_feature = 1024
self.batch_size = args.batch_size
self.data_path = args.data_path
self.model_path = args.model_path
self.output_path = args.output_path
self.log_path = args.log_path
self.num_workers = args.num_workers
self.alpha = args.alpha
self.beta = args.beta
self.margin = args.margin
self.r_act = args.r_act
self.r_bkg = args.r_bkg
self.class_thresh = args.class_th
self.act_thresh_cas = np.arange(0.0, 0.25, 0.025)
self.act_thresh_magnitudes = np.arange(0.4, 0.625, 0.025)
self.scale = 24
self.gt_path = os.path.join(self.data_path, 'gt.json')
self.model_file = args.model_file
self.seed = args.seed
self.feature_fps = 25
self.num_segments = 750
def __str__(self):
attrs = vars(self)
attr_lst = sorted(attrs.keys())
return '\n'.join("- %s: %s" % (item, attrs[item]) for item in attr_lst if item != 'lr')
class_dict = {0: 'BaseballPitch',
1: 'BasketballDunk',
2: 'Billiards',
3: 'CleanAndJerk',
4: 'CliffDiving',
5: 'CricketBowling',
6: 'CricketShot',
7: 'Diving',
8: 'FrisbeeCatch',
9: 'GolfSwing',
10: 'HammerThrow',
11: 'HighJump',
12: 'JavelinThrow',
13: 'LongJump',
14: 'PoleVault',
15: 'Shotput',
16: 'SoccerPenalty',
17: 'TennisSwing',
18: 'ThrowDiscus',
19: 'VolleyballSpiking'}