-
Notifications
You must be signed in to change notification settings - Fork 3
/
inf_rgb.py
74 lines (52 loc) · 3.49 KB
/
inf_rgb.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
72
73
74
'最终融合'
import pandas as pd
import numpy as np
def softmax(x, dim=1):
e_x = np.exp(x - np.max(x, axis=dim, keepdims=True))
return e_x / e_x.sum(axis=dim, keepdims=True)
slowonly_RGB_pse = np.load("./inference_testphase/slowonly_addvelset_addtestsetv1_lr_0.01_cropratio0.08_epoch87.npy")
slowonly_depth_pse = np.load("./inference_testphase/slowonly_addvalset_addtestsetv1_depth_epoch81.npy")
slowonly_detect_RGB_pse = np.load("./inference_testphase/slowonly_addvalset_addtestsetv1_detect_RGB_epoch92.npy")
slowonly_detect_depth_pse = np.load("./inference_testphase/slowonly_addvalset_addtestsetv1_detect_depth_epoch60.npy")
TSM_RGB_flow_pse = np.load("./inference_testphase/TSM_addvalset_addtestsetv1_RGBflow_finetune_Epoch10.npy")
TSM_RGB_finetune_pse = np.load("./inference_testphase/TSM_addvalset_addtestsetv1_RGB_finetune_Epoch10.npy")
TSM_depth_flow_pse = np.load("./inference_testphase/TSM_addvalset_addtestsetv1_depth_flow_Epoch10.npy")
slowonly_RGB_input256_inference288_pse = np.load("./inference_testphase/slowonly_addvalset_addtestsetv1_input256_inference288_epoch98.npy")
import pickle
slowfast_RGB_nln = pickle.load(open('./inference_testphase/results_9543.pkl', 'rb'))[0].numpy() / 30
slowfast_seg_nln = pickle.load(open('./inference_testphase/results_seg.pkl', 'rb'))[0].numpy() / 30
slowfast_RGB_256_nln = pickle.load(open('./inference_testphase/results256_pse3.pkl', 'rb'))[0].numpy() / 90
slowfast_RGB = pickle.load(open('./inference_testphase/results.pkl', 'rb'))[0].numpy() / 30
slowfast_RGB_256 = pickle.load(open('./inference_testphase/results_y.pkl', 'rb'))[0].numpy() / 30
slowfast_flowy_nln = pickle.load(open('./inference_testphase/results_flowy.pkl', 'rb'))[0].numpy() / 30
slowfast_flowx_256_nln = pickle.load(open('./inference_testphase/results256_flowx.pkl', 'rb'))[0].numpy() / 90
slowfast_a_flowx = pickle.load(open('./inference_testphase/results_x.pkl', 'rb'))[0].numpy() / 30
slowfast_a_flowy = pickle.load(open('./inference_testphase/results_y.pkl', 'rb'))[0].numpy() / 30
slowfast_a_RGB = pickle.load(open('./inference_testphase/results_mg_test.pkl', 'rb'))[0].numpy() / 30
slowfast_a_RGB_256 = pickle.load(open('./inference_testphase/results_256_test.pkl', 'rb'))[0].numpy() / 90
slowfast_a_RGB_nln = pickle.load(open('./inference_testphase/results_nln_test.pkl', 'rb'))[0].numpy() / 30
slowfast_depth = pickle.load(open('./inference_testphase/results256_depth.pkl', 'rb'))[0].numpy() / 90
# print(np.max(slowfast_RGB_256_nln, axis=1))
# print(slowfast_flowx_256_nln + slowonly_RGB_input256_inference288_pse)
# import pdb;pdb.set_trace()
corporate = 1 * slowfast_RGB \
+ 2.5 * slowfast_RGB_256 \
+ 1 * slowfast_RGB_256_nln \
+ 1 * slowfast_RGB_nln \
+ 2.5 * slowfast_seg_nln \
+ 1 * slowfast_flowx_256_nln \
+ 1 * slowfast_flowy_nln
corporate1 = 1.5 * slowonly_RGB_pse \
+ 1.5 * slowonly_detect_RGB_pse \
+ 1 * slowonly_RGB_input256_inference288_pse \
+ 1 * TSM_RGB_flow_pse \
+ 1.5 * TSM_RGB_finetune_pse
# corporate1 = corporate1
corporate = 1.1 * corporate + 0.3 *corporate1
predictions = pd.read_csv("./inference_testphase/predictions_testphase.csv",header=None)
line = []
for i in range(len(corporate)):
pred = np.argsort(corporate[i])[-1]
line.append([predictions.iloc[i,0],pred])
data = pd.DataFrame(data=line)
data.to_csv("predictions.csv",header=None,index=None,sep=",")