-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparam_search.py
46 lines (41 loc) · 1.48 KB
/
param_search.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
import subprocess
import numpy as np
for threshold in np.arange(1., .1, -0.1):
print('Threshold: {}'.format(threshold))
command = ' '.join([
'python main.py --cfg-file config/anet_detection.yaml',
'BMN.POST_PROCESS.SOFT_NMS_ALPHA {}'
])
subprocess.run(command.format(threshold), shell=True)
'''
for threshold in np.arange(0.1, 1.0, 0.1):
alpha = 0.4
print('Threshold: {}\tAlpha: {}'.format(threshold, alpha))
command = ' '.join([
'python main.py --cfg-file config/anet_proposal.yaml',
'BMN.POST_PROCESS.SOFT_NMS_ALPHA {}',
'BMN.POST_PROCESS.SOFT_NMS_LOW_THRESHOLD {}',
'BMN.POST_PROCESS.SOFT_NMS_HIGH_THRESHOLD {}'
])
subprocess.run(command.format(alpha, threshold, threshold), shell=True)
'''
'''
for i in range(10):
model_path = 'checkpoints/thumos_c3d_checkpoints/checkpoint_{}/[email protected]'.format(i + 4)
print('Evaluate model {}.'.format(model_path))
command = ' '.join([
'python main.py --cfg-file config/thumos_proposal.yaml',
'MODE "validation"',
'TEST.CHECKPOINT_PATH {}',
])
subprocess.run(command.format(model_path), shell=True)
'''
'''
for nms_threshold in np.linspace(0.05, 1.0, 20):
print('Evaluate Hard NMS Threshold {}.'.format(nms_threshold))
command = ' '.join([
'python main.py --cfg-file config/thumos_detection.yaml',
'BMN.POST_PROCESS.HARD_NMS_THRESHOLD {}'.format(nms_threshold)
])
subprocess.run(command, shell=True)
'''