├── CNN.py
├── Data_Scanning.py
├── Image_Scanning.py
├── Needed_Package.txt
├── PNG
├── Video_Frames_Distribution.png
├── merged_a02_v01_s07_e04.jpg
├── models_test_result.png
├── models_val_result.png
├── readme
└── three_data_partition_distribution.png
├── README.md
├── code_test.py
├── core
├── __init__.py
├── __init__.pyc
├── model.py
├── model.pyc
├── solver.py
├── solver.pyc
├── utils.py
├── utils.pyc
├── vggnet.py
└── vggnet.pyc
├── data
├── data_set
│ ├── partition_distribution.txt
│ ├── test
│ │ ├── detailed_record.txt
│ │ ├── percentage record.txt
│ │ └── readme
│ ├── train
│ │ └── readme
│ └── val
│ │ └── readme
├── image
│ └── readme
├── log
│ └── readme
└── model
│ ├── models_accuracy_val.txt
│ └── readme
├── pre-data.py
└── train.py
/CNN.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | import tensorflow as tf
3 | from scipy import ndimage
4 | from core.vggnet import Vgg19
5 | from core.utils import *
6 | import numpy as np
7 | import os
8 | import hickle
9 | # from datetime import datetime
10 |
11 |
12 | def comp(x, y):
13 | x_num = int(x[:-4])
14 | y_num = int(y[:-4])
15 | if x_num > y_num:
16 | return 1
17 | if x_num < y_num:
18 | return -1
19 | if x_num == y_num:
20 | return 0
21 |
22 |
23 | def main():
24 | PATH = os.getcwd()
25 | vgg_model_path = PATH + '/data/imagenet-vgg-verydeep-19.mat'
26 | num_of_image_per_video = 17
27 | type = ['train', 'val', 'test']
28 | # TIME = str(datetime.now())
29 | vggnet = Vgg19(vgg_model_path)
30 | vggnet.build()
31 | with tf.Session() as sess:
32 | tf.initialize_all_variables().run()
33 | for each in type:
34 |
35 | # settle down the paths
36 | path = PATH + '/data/data_set/' + each + '/'
37 | save_path_feats = path + 'features_' + each + '.hkl'
38 | save_path_labels_all = path + 'labels_all_' + each + '.hkl'
39 |
40 | # load video_filenames and labels
41 | video_filename = load_pickle(path + 'video_filenames_' + each + '.pkl')
42 | labels = load_pickle(path + 'labels_' + each + '.pkl')
43 |
44 | # gather the whole data in the current type
45 | all_feats = np.ndarray([len(video_filename), num_of_image_per_video, 196, 512], dtype=np.float32)
46 | all_labels = [None] * len(video_filename)
47 |
48 | # feature extraction
49 | for idx, vf in enumerate(video_filename):
50 | images_list = sorted(list(os.walk(vf))[0][-1], cmp=comp)
51 | print ('Processed' + str(idx + 1) + 'videos..')
52 |
53 | # # generate images_path
54 | cur_images_path = [vf + '/' + image for image in images_list]
55 | step = int(float(len(images_list)) / float(num_of_image_per_video))
56 | print(step)
57 |
58 | # Supplement
59 | if step == 0:
60 | cur_images_path += [cur_images_path[-1]] * (num_of_image_per_video - len(cur_images_path))
61 |
62 | # do not jump
63 | if step == 1:
64 | # cut from the middle
65 | start_num = np.floor(float(len(images_list) - num_of_image_per_video) / 2)
66 | start = 1 if start_num == 0 else start_num
67 | cur_images_path = cur_images_path[int(start - 1):int(num_of_image_per_video + start - 1)]
68 |
69 | # jump
70 | if step > 1:
71 | # cut by jumping -- start from the bottom of each partition
72 | cur_images_path = cur_images_path[step - 1::step]
73 | # cut from the middle again in case of the residual effects
74 | start_num = np.floor(float(len(cur_images_path) - num_of_image_per_video) / 2)
75 | start = 1 if start_num == 0 else start_num
76 | cur_images_path = cur_images_path[int(start - 1):int(num_of_image_per_video + start - 1)]
77 |
78 | # in case of failure
79 | if len(cur_images_path) != num_of_image_per_video:
80 | print('step: ' + str(step))
81 | print('length of origianl images: ' + str(len(images_list)))
82 | print('length of standard: ' + str(num_of_image_per_video))
83 | print('length: ' + str(len(cur_images_path)))
84 | print('errors occur..')
85 | exit()
86 |
87 | cur_labels = labels[idx]
88 |
89 | # read images and extract features
90 | image_batch = np.array(
91 | map(lambda x: ndimage.imread(x, mode='RGB'), cur_images_path)).astype(np.float32)
92 | feats = sess.run(vggnet.features, feed_dict={vggnet.images: image_batch})
93 |
94 | all_feats[idx, :] = feats
95 | all_labels[idx] = [cur_labels] * num_of_image_per_video
96 |
97 | # use hickle to save huge feature vectors
98 | hickle.dump(all_feats, save_path_feats)
99 | all_labels = np.array(all_labels)
100 | hickle.dump(all_labels, save_path_labels_all)
101 | print ("Saved %s.." % save_path_feats)
102 |
103 | # # log each process
104 | # txt = open(path + 'log_' + each + '.txt', 'a')
105 | # txt.close()
106 |
107 |
108 | main()
109 |
--------------------------------------------------------------------------------
/Data_Scanning.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | from core.utils import *
3 | from collections import Counter
4 | from datetime import datetime
5 |
6 | data_path = '/home/jingwei/Action Detection/A-R/data/data_set/'
7 | folders = ['train', 'test', 'val']
8 | label_to_id = load_pickle(data_path + 'label_to_idx.pkl')
9 |
10 | txt = open(data_path + 'partition_distribution.txt', 'a+')
11 | txt.write(str(datetime.now()) + '\r\n')
12 |
13 | for folder in folders:
14 | txt.write(folder + '_partition_distribution:' + '\r\n')
15 | cur_labels = load_pickle(data_path + folder + '/' + 'labels_' + folder + '.pkl')
16 | # analysis_distribution
17 | label_ids = [label_to_id[per] for per in cur_labels]
18 | total = len(label_ids)
19 | dict_counter = Counter(label_ids)
20 | txt.write('Total number: ' + str(total) + '\r\n')
21 |
22 | for type in range(0, 10):
23 | percentage = float(dict_counter[type + 1]) / float(total)
24 | txt.write(str(type + 1) + ': ' + str(round(float(percentage), 4) * 100) + '%\r\n')
25 | txt.write('\r\n')
26 | print(folder + ' processed..')
27 | txt.close()
28 |
--------------------------------------------------------------------------------
/Image_Scanning.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | import os
3 | from datetime import datetime
4 |
5 | comp = lambda x, y: 1 if int(x) > int(y) else -1 if int(x) < int(y) else 0
6 | image_path = '/home/jingwei/Action Detection/A-R/data/image/'
7 | folders = ['a01', 'a02', 'a03', 'a04', 'a05', 'a06', 'a08', 'a09', 'a11', 'a12']
8 |
9 | cur_txt = open(image_path + 'Video_distribution.txt', 'a+')
10 | cur_txt.write(str(datetime.now()) + '\r\n')
11 |
12 | for folder in folders:
13 | tmp_dic = {}
14 | cur_txt.write(folder + ': ' + '\r\n')
15 | cur_path = image_path + folder + '/'
16 | sub_folders_list = list(os.walk(cur_path))[0][1]
17 | valid_num = 0
18 | for sub_folder in sub_folders_list:
19 | cur_sub_path = cur_path + sub_folder + '/'
20 | images_list_length = len(list(os.walk(cur_sub_path))[0][-1])
21 | # dict_building
22 | if tmp_dic.keys().count(str(images_list_length)) == 0:
23 | tmp_dic[str(images_list_length)] = 1
24 | else:
25 | tmp_dic[str(images_list_length)] += 1
26 | tmp_dic_keys = sorted(tmp_dic.keys(), cmp=comp)
27 | # write txt
28 | for per in tmp_dic_keys:
29 | cur_txt.write(per + ' frames: ' + str(tmp_dic[per]) + ' videos\n')
30 | cur_txt.write('total number of videos: ' + str(len(sub_folders_list)) + '\n')
31 | cur_txt.write('\r\n')
32 | print(folder + ' processed..')
33 | cur_txt.close()
34 |
--------------------------------------------------------------------------------
/Needed_Package.txt:
--------------------------------------------------------------------------------
1 | numpy
2 | scipy
3 | hickle
4 | cPickle
5 | collections
6 |
--------------------------------------------------------------------------------
/PNG/Video_Frames_Distribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/PNG/Video_Frames_Distribution.png
--------------------------------------------------------------------------------
/PNG/merged_a02_v01_s07_e04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/PNG/merged_a02_v01_s07_e04.jpg
--------------------------------------------------------------------------------
/PNG/models_test_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/PNG/models_test_result.png
--------------------------------------------------------------------------------
/PNG/models_val_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/PNG/models_val_result.png
--------------------------------------------------------------------------------
/PNG/readme:
--------------------------------------------------------------------------------
1 | This folder provides required images in REAMD.
2 |
--------------------------------------------------------------------------------
/PNG/three_data_partition_distribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/PNG/three_data_partition_distribution.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Action_Recognition_using_Visual_Attention
2 |
3 | Update (August 16, 2017) TensorFlow Implementation of [Action Recognition using Visual Attention](https://arxiv.org/abs/1511.04119) which introduces an attention based action recognition discriminator. The model inputed with a video will shift its attention along the frames, label each frame, and select the merging label with the highest frequency of occurance as the final label of the video.
4 |
5 |
6 |
7 |
8 | ## References
9 |
10 | Author's Theano implementation: https://github.com/kracwarlock/action-recognition-visual-attention
11 |
12 | Show, Attend and Tell: Neural Image Caption Generation with Visual Attention: https://arxiv.org/abs/1502.03044
13 |
14 | Show, Attend and Tell's Tensorflow implementation: https://github.com/yunjey/show-attend-and-tell
15 |
16 | Used Data: http://users.eecs.northwestern.edu/~jwa368/my_data.html
17 |
18 |
19 |
20 |
21 | ## Start
22 |
23 | ### Prerequisites
24 |
25 | First, clone this repository and download the video data experimented in this project.
26 |
27 | ```bash
28 | $ git clone https://github.com/Adopteruf/Action_Recognition_using_Visual_Attention
29 | $ wget users.eecs.northwestern.edu/~jwa368/data/multiview_action_videos.tgz
30 | ```
31 |
32 | unzipping the download video data and copying it into '/data/image/' can be conducted manually.
33 | This code is written in Python2.7 and requires Tensorflow. Besides, there are several package and files needed to be install. Running the command below can help to download the necessary tools and download the VGGNet19 model in 'data/' directory.
34 |
35 | ```bash
36 | $ cd Action_Recognition_using_Visual_Attention
37 | $ pip2 install -r Needed_Package.txt
38 | $ sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
39 | $ sudo apt-get update
40 | $ sudo apt-get install ffmpeg
41 | $ wget http://www.vlfeat.org/matconvnet/models/imagenet-vgg-verydeep-19.mat -P data/
42 | ```
43 |
44 |
45 | For breaking the download videos into images along the frames and distribute them into three partitions including 'train/', 'val/', and 'test/' following the proporation: 0.6:0.2:0.2.
46 |
47 | ```bash
48 | $ python pre-data.py
49 | ```
50 |
51 | Then, we need to extract the features from images prepared for the further training.
52 |
53 | ```bash
54 | $ python CNN.py
55 | ```
56 |
57 |
58 |
59 |
60 | ### Training
61 |
62 | Run the command below to train the action recognition model.
63 |
64 | ```bash
65 | $python train.py
66 |
67 | ```
68 |
69 | After enter this command, the model will be trained based on the 'train' data-set and the whole models saved during the training process will be examed based on 'val' data-set. The user can pick the model with highest performance and exam it based on 'test' data-set.
70 |
71 | Here is an experimental case.
72 |
73 | #### models validated based 'val/' data-set
74 |
75 | 
76 |
77 |
78 |
79 | #### models tested based on 'test/' data-set
80 |
81 | 
82 |
83 |
84 |
85 |
86 |
87 | ### Results
88 |
89 | Here is one test case.
90 | 'stand up': 2
91 | 'pick up with one hand': 6
92 |
93 | 
94 | The selected labels for the 17 frames are: 2 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
95 | The final label: pick up with one hand
96 |
97 |
98 |
99 | ### Reminder
100 |
101 | Besides, the codes: Data_Scanning.py and Image_Scanning.py can help to measure the data distribution of the corresponding data-set.
102 | For example,
103 |
104 | ```bash
105 | $ python Data_Scanning.py
106 | ```
107 |
108 | #### three_data_partition_distribution
109 |
110 | 
111 |
112 |
113 |
114 | ```bash
115 | $ python Image_Scanning.py
116 | ```
117 |
118 | #### Video_Frames_Distribution
119 |
120 | 
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/code_test.py:
--------------------------------------------------------------------------------
1 | from core.utils import *
2 |
--------------------------------------------------------------------------------
/core/__init__.py:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/core/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/core/__init__.pyc
--------------------------------------------------------------------------------
/core/model.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | from __future__ import division
3 | import tensorflow as tf
4 |
5 |
6 | class CaptionGenerator(object):
7 | def __init__(self, label_to_idx, dim_feature, dim_hidden=1024, n_time_step=17,
8 | ctx2out=True, alpha_c=1.0, selector=False, dropout=False):
9 | """
10 | Args:
11 | ctx2out: context to hidden state.
12 | alpha_c: Doubly stochastic regularization coefficient.
13 | selector: gating scalar for context vector.
14 | dropout: If true then dropout layer is added.
15 | V: the length of the possible labels
16 | L: the features' number of each image
17 | D: the features' dimension
18 | T: time step
19 | n_time_step: the same with T
20 | """
21 | # dictionary data
22 | self.label_to_idx = label_to_idx
23 | comp = lambda x, y: 1 if label_to_idx[x] > label_to_idx[y] else -1 if label_to_idx[x] < label_to_idx[y] else 0
24 | self.idx_to_label = sorted(label_to_idx.keys(), cmp=comp)
25 |
26 | # optional choice
27 | self.ctx2out = ctx2out
28 | self.alpha_c = alpha_c
29 | self.selector = selector
30 | self.dropout = dropout
31 |
32 | # key parameters
33 | self.V = len(self.idx_to_label)
34 | self.L = dim_feature[0]
35 | self.D = dim_feature[1]
36 | self.H = dim_hidden
37 | # self.M = len(label_to_idx.keys())
38 | self.T = n_time_step
39 | self.n_time_step = n_time_step
40 |
41 | # initializer
42 | self.weight_initializer = tf.contrib.layers.xavier_initializer()
43 | self.const_initializer = tf.constant_initializer(0.0)
44 |
45 | # Place holder for features and captions
46 | self.features = tf.placeholder(tf.float32, [None, self.n_time_step, self.L, self.D])
47 | # labels contains label for each video in the batch-video
48 | self.label_idxs = tf.placeholder(tf.int32, [None, self.n_time_step])
49 |
50 | # set the initial state of lstm cell
51 | def _get_initial_lstm(self, features, name):
52 | with tf.variable_scope(name):
53 | features_mean = tf.reduce_mean(features, 1)
54 | features_mean = tf.reshape(features_mean, [-1, self.T, self.D])
55 | features_mean = tf.reduce_mean(features_mean, 1)
56 |
57 | w_h = tf.get_variable('w_h', [self.D, self.H], initializer=self.weight_initializer)
58 | b_h = tf.get_variable('b_h', [self.H], initializer=self.const_initializer)
59 | h = tf.nn.tanh(tf.matmul(features_mean, w_h) + b_h)
60 |
61 | w_c = tf.get_variable('w_c', [self.D, self.H], initializer=self.weight_initializer)
62 | b_c = tf.get_variable('b_c', [self.H], initializer=self.const_initializer)
63 | c = tf.nn.tanh(tf.matmul(features_mean, w_c) + b_c)
64 | return c, h
65 |
66 | # reshape features? why do that projection? --- problem: the reason of doing that
67 | def _project_features(self, features):
68 | with tf.variable_scope('project_features'):
69 | w = tf.get_variable('w', [self.D, self.D], initializer=self.weight_initializer)
70 | features_flat = tf.reshape(features, [-1, self.D])
71 | features_proj = tf.matmul(features_flat, w)
72 | features_proj = tf.reshape(features_proj, [-1, self.L, self.D])
73 | return features_proj
74 |
75 | # attention model layer
76 | def _attention_layer(self, features, features_proj, h, reuse):
77 | with tf.variable_scope('attention_layer', reuse=reuse):
78 | w = tf.get_variable('w', [self.H, self.D], initializer=self.weight_initializer)
79 | b = tf.get_variable('b', [self.D], initializer=self.const_initializer)
80 | w_att = tf.get_variable('w_att', [self.D, 1], initializer=self.weight_initializer)
81 |
82 | h_att = tf.nn.relu(features_proj + tf.expand_dims(tf.matmul(h, w), 1) + b)
83 | out_att = tf.reshape(tf.matmul(tf.reshape(h_att, [-1, self.D]), w_att), [-1, self.L])
84 | alpha = tf.nn.softmax(out_att)
85 | context = tf.reduce_sum(features * tf.expand_dims(alpha, 2), 1, name='context')
86 | return context, alpha
87 |
88 | # update the memory using selector
89 | def _selector(self, context, h, reuse):
90 | with tf.variable_scope('selector', reuse=reuse):
91 | w = tf.get_variable('w', [self.H, 1], initializer=self.weight_initializer)
92 | b = tf.get_variable('b', [1], initializer=self.const_initializer)
93 | beta = tf.nn.sigmoid(tf.matmul(h, w) + b, 'beta') # (N, 1)
94 | context = tf.mul(beta, context, name='selected_context')
95 | return context, beta
96 |
97 | # decoding of lstm
98 | def _decode_lstm(self, h, context, dropout, reuse):
99 | with tf.variable_scope('logits', reuse=reuse):
100 | w_h = tf.get_variable('w_h', [self.H, self.V], initializer=self.weight_initializer)
101 | b_h = tf.get_variable('b_h', [self.V], initializer=self.const_initializer)
102 | w_out = tf.get_variable('w_out', [self.V, self.V], initializer=self.weight_initializer)
103 | b_out = tf.get_variable('b_out', [self.V], initializer=self.const_initializer)
104 |
105 | if dropout:
106 | h = tf.nn.dropout(h, 0.5)
107 | h_logits = tf.matmul(h, w_h) + b_h
108 |
109 | if self.ctx2out:
110 | w_ctx2out = tf.get_variable('w_ctx2out', [self.D, self.V], initializer=self.weight_initializer)
111 | h_logits += tf.matmul(context, w_ctx2out)
112 | h_logits = tf.nn.tanh(h_logits)
113 |
114 | if dropout:
115 | h_logits = tf.nn.dropout(h_logits, 0.5)
116 | out_logits = tf.matmul(h_logits, w_out) + b_out
117 |
118 | return out_logits
119 |
120 | # normalize batch data
121 | def _batch_norm(self, x, mode='train', name=None):
122 | return tf.contrib.layers.batch_norm(inputs=x,
123 | decay=0.95,
124 | center=True,
125 | scale=True,
126 | is_training=(mode == 'train'),
127 | updates_collections=None,
128 | scope=(name + 'batch_norm'))
129 |
130 | def build_model(self):
131 | # data prior process
132 | features = self.features
133 | features = tf.reshape(features, [-1, self.L, self.D])
134 | batch_size = tf.shape(features)[0] / self.V
135 | features = self._batch_norm(features, mode='test&val', name='Conv_features')
136 | features_proj = self._project_features(features=features)
137 |
138 | loss = 0.0
139 | alpha_list = []
140 |
141 | # LSTM ----------------------one layer---------------------------- START
142 | lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(num_units=self.H)
143 | c, h = self._get_initial_lstm(features=features, name='lstm-cell')
144 | # labels to label_idxs
145 | for t in range(self.T): # each t of lstm-layers process
146 | context, alpha = self._attention_layer(features[t::self.T], features_proj[t::self.T], h,
147 | reuse=(t != 0))
148 | alpha_list.append(alpha)
149 |
150 | # update after adding this procession the outcome improved dramatically --- more quick to learn that
151 | if self.selector:
152 | context, beta = self._selector(context, h, reuse=(t != 0))
153 |
154 | with tf.variable_scope("LSTM", reuse=(t != 0)):
155 | _, (c, h) = lstm_cell(context, (c, h))
156 |
157 | logits = self._decode_lstm(h, context, dropout=self.dropout, reuse=(t != 0))
158 | loss += tf.reduce_sum(tf.nn.sparse_softmax_cross_entropy_with_logits(logits, self.label_idxs[:, t]))
159 | # LSTM ----------------------one layer----------------------------- END
160 |
161 | # add the regulation to the cost function or not and the coefficients here needed to be adjusted
162 | if self.alpha_c > 0: # # -------------------check it later
163 | alphas = tf.transpose(tf.pack(alpha_list), (1, 0, 2))
164 | alphas_all = tf.reduce_sum(alphas, 1)
165 | alpha_reg = self.alpha_c * tf.reduce_sum((self.T / 196 - alphas_all) ** 2)
166 | loss += alpha_reg
167 |
168 | return loss / tf.to_float(batch_size)
169 |
170 | def build_sampler(self):
171 | # data collection
172 | features = self.features
173 | features = tf.reshape(features, [-1, self.L, self.D])
174 | features = self._batch_norm(features, mode='test&val', name='Conv_features')
175 | features_proj = self._project_features(features=features)
176 |
177 | alpha_list = []
178 | beta_list = []
179 | sampled_label_index_list = []
180 |
181 | # LSTM -----------------------one layer-------------------------------- START
182 | lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(num_units=self.H)
183 | c, h = self._get_initial_lstm(features=features, name='lstm-cell')
184 | for t in range(self.T): # each t of lstm-layers process
185 | context, alpha = self._attention_layer(features[t::self.T], features_proj[t::self.T], h,
186 | reuse=(t != 0))
187 | alpha_list.append(alpha)
188 |
189 | if self.selector:
190 | context, beta = self._selector(context, h, reuse=(t != 0))
191 | beta_list.append(beta)
192 |
193 | with tf.variable_scope("LSTM", reuse=(t != 0)):
194 | _, (c, h) = lstm_cell(context, (c, h))
195 |
196 | logits = self._decode_lstm(h, context, dropout=self.dropout, reuse=(t != 0))
197 | # LSTM ------------------------one layer------------------------------- END
198 |
199 | # logits to possibility
200 | possibility = tf.nn.softmax(logits)
201 | sampled_label_index_each_t = tf.argmax(possibility, 1)
202 | sampled_label_index_list.append(sampled_label_index_each_t)
203 |
204 | # alphas = tf.transpose(tf.pack(alpha_list), (1, 0, 2)) # (N, T, L)
205 | # betas = tf.transpose(tf.squeeze(beta_list), (1, 0)) # (N, T)
206 | alphas = alpha_list
207 | betas = beta_list
208 | return alphas, betas, sampled_label_index_list
209 |
--------------------------------------------------------------------------------
/core/model.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/core/model.pyc
--------------------------------------------------------------------------------
/core/solver.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | from __future__ import print_function
3 | import tensorflow as tf
4 | from utils import *
5 | import numpy as np
6 | import time
7 | from datetime import datetime
8 | import os
9 |
10 |
11 | class CaptioningSolver(object):
12 | def __init__(self, model, data, **kwargs):
13 |
14 | self.model = model
15 | self.train_data = data['train_data']
16 | self.n_epochs = kwargs.pop('n_epochs')
17 | self.batch_size = kwargs.pop('batch_size')
18 | self.update_rule = kwargs.pop('update_rule')
19 | self.learning_rate = kwargs.pop('learning_rate')
20 |
21 | self.print_every = kwargs.pop('print_every')
22 | self.save_every = kwargs.pop('save_every')
23 |
24 | self.data_path = kwargs.pop('data_path')
25 |
26 | self.log_path = kwargs.pop('log_path')
27 | self.model_path = kwargs.pop('model_path')
28 | self.test_result_save_path = kwargs.pop('test_result_save_path')
29 | self.models_val_disp = kwargs.pop('models_val_disp')
30 |
31 | self.pretrained_model = kwargs.pop('pretrained_model')
32 | self.test_model = kwargs.pop('test_model')
33 |
34 | # set an optimizer by update rule
35 | if self.update_rule == 'adam':
36 | self.optimizer = tf.train.AdamOptimizer
37 | elif self.update_rule == 'momentum':
38 | self.optimizer = tf.train.MomentumOptimizer
39 | elif self.update_rule == 'rmsprop':
40 | self.optimizer = tf.train.RMSPropOptimizer
41 |
42 | # create necessary folders
43 | if not os.path.exists(self.model_path):
44 | os.makedirs(self.model_path)
45 | if not os.path.exists(self.log_path):
46 | os.makedirs(self.log_path)
47 | if not os.path.exists(self.test_result_save_path):
48 | os.makedirs(self.test_result_save_path)
49 |
50 | def train(self):
51 | # train dataset
52 | features = np.array(self.train_data['features'])
53 | labels = np.array(self.train_data['labels'])
54 | video_ids = np.array(self.train_data['video_ids'])
55 |
56 | n_iters_per_epoch = int(len(labels) / self.batch_size)
57 |
58 | # # mix up the training data
59 | # rand_idxs = np.random.permutation(len(labels))
60 | # labels = labels1[rand_idxs]
61 | # video_ids = video_ids1[rand_idxs]
62 | # features = features[rand_idxs]
63 |
64 | # build graphs for training model and sampling captions
65 | loss = self.model.build_model()
66 | tf.get_variable_scope().reuse_variables() # set the 'reuse' of each variable as True
67 | _, _, sam_labels = self.model.build_sampler()
68 |
69 | # train op
70 | with tf.name_scope('optimizer'):
71 | optimizer = self.optimizer(learning_rate=self.learning_rate)
72 | grads = tf.gradients(loss, tf.trainable_variables())
73 | grads_and_vars = list(zip(grads, tf.trainable_variables()))
74 | train_op = optimizer.apply_gradients(grads_and_vars=grads_and_vars)
75 | tf.scalar_summary('batch_loss', loss) # add those to the observing process
76 |
77 | # add the variables into observation
78 | for var in tf.trainable_variables():
79 | tf.histogram_summary(var.op.name, var)
80 | for grad, var in grads_and_vars:
81 | tf.histogram_summary(var.op.name + '/gradient', grad)
82 |
83 | # train_summary = tf.merge_all_summaries()
84 | print("The number of epoch: %d" % self.n_epochs)
85 | print("Data size: %d" % (len(labels)))
86 | print("Batch size: %d" % self.batch_size)
87 | print("Iterations per epoch: %d" % (n_iters_per_epoch))
88 |
89 | config = tf.ConfigProto(allow_soft_placement=True)
90 | # config.gpu_options.per_process_gpu_memory_fraction=0.9
91 | config.gpu_options.allow_growth = True
92 | with tf.Session(config=config) as sess:
93 | print('Session created')
94 | tf.initialize_all_variables().run()
95 | # train_summary_writer = tf.train.SummaryWriter(self.log_path, graph=tf.get_default_graph())
96 | saver = tf.train.Saver(max_to_keep=50)
97 |
98 | if self.pretrained_model is not None:
99 | print("Start training with pretrained Model..")
100 | saver.restore(sess, self.pretrained_model)
101 |
102 | prev_loss = -1
103 | curr_loss = 0
104 | start_t = time.time()
105 |
106 | # training process -- n_epochs iterations + n_iter_per_epoch
107 | for e in range(self.n_epochs):
108 | for i in range(n_iters_per_epoch):
109 | S = i * self.batch_size
110 | E = (i + 1) * self.batch_size
111 | labels_batch = labels[S:E]
112 | video_ids_batch = video_ids[S:E]
113 | features_batch = features[S:E]
114 | label_batch_idxs = np.array([[self.model.label_to_idx[per] for per in PER] for PER in labels_batch])
115 |
116 | feed_dict = {self.model.features: features_batch, self.model.label_idxs: label_batch_idxs}
117 | _, l = sess.run([train_op, loss], feed_dict)
118 |
119 | curr_loss += l
120 |
121 | # # write summary for tensorboard visualization
122 | # if i % 10 == 0:
123 | # summary = sess.run(train_summary, feed_dict)
124 | # train_summary_writer.add_summary(summary, e * n_iters_per_epoch + i)
125 |
126 | # show the current training condition
127 | if (i + 1) % self.print_every == 0:
128 | print("\nTrain loss at epoch %d & iteration %d (mini-batch): %.5f" % (e + 1, i + 1, l))
129 | sam_labels_list = sess.run(sam_labels, feed_dict)
130 |
131 | # decode the training result
132 | gen_label_idxs, gen_labels = decode(sam_labels_list, self.model.idx_to_label)
133 | org_label_idxs = label_batch_idxs[:, 0]
134 |
135 | # visualize the current comparison
136 | for j in range(len(org_label_idxs)):
137 | print(video_ids_batch[j])
138 | Ground_truth = 'org: ' + str(org_label_idxs[j])
139 | Generated_one = 'gen: ' + str(gen_label_idxs[j])
140 | print(Ground_truth + '--V.S.--' + Generated_one)
141 | print('the current accurancy rate: ' +
142 | str(accurate_percentage(gen_label_idxs, org_label_idxs)))
143 |
144 | print("Previous epoch loss: ", prev_loss)
145 | print("Current epoch loss: ", curr_loss)
146 | print("Elapsed time: ", time.time() - start_t)
147 | prev_loss = curr_loss
148 | curr_loss = 0
149 |
150 | # save model's parameters
151 | if (e + 1) % self.save_every == 0:
152 | saver.save(sess, self.model_path + 'model', global_step=e + 1)
153 | print("model-%s saved." % (e + 1))
154 |
155 | # test one model in test set
156 | def test(self):
157 | # train dataset
158 | test_data = load_data(self.data_path, 'test')
159 | features = np.array(test_data['features'])
160 | labels = np.array(test_data['labels'])
161 | video_ids = np.array(test_data['video_ids'])
162 | n_iterations = int(len(labels) / self.batch_size)
163 |
164 | test_result_save_path = self.test_result_save_path
165 |
166 | # build a graph to sample labels
167 | alphas, betas, sam_labels_test = self.model.build_sampler()
168 |
169 | # percentage record.txt
170 | percentage_txt = open(test_result_save_path + 'percentage record.txt', 'a')
171 | percentage_txt.write(str(datetime.now()) + '_test_' + '\r\n')
172 | percentage_txt.write('model path: ' + self.test_model + '\r\n')
173 | percentage_txt.write('\r\n')
174 |
175 | # detail record.txt
176 | txt_file = open(test_result_save_path + 'detailed_record.txt', 'a')
177 | txt_file.write(str(datetime.now()) + '_test_' + '\r\n')
178 | txt_file.write('model path: ' + self.test_model + '\r\n')
179 | txt_file.write('\r\n')
180 |
181 | MATCH_RESULT = {}
182 | config = tf.ConfigProto(allow_soft_placement=True)
183 | config.gpu_options.allow_growth = True
184 | with tf.Session(config=config) as sess:
185 | saver = tf.train.Saver()
186 | saver.restore(sess, self.test_model)
187 | AP_ALL = np.ndarray(n_iterations)
188 |
189 | for iter in range(n_iterations):
190 | S = iter * self.batch_size
191 | E = (iter + 1) * self.batch_size
192 |
193 | # batch-data
194 | features_batch = features[S:E]
195 | labels_batch = labels[S:E]
196 | video_id_batch = video_ids[S:E]
197 |
198 | # run the model
199 | label_idxs = np.array([[self.model.label_to_idx[per] for per in PER] for PER in labels_batch])
200 | feed_dict = {self.model.features: features_batch, self.model.label_idxs: label_idxs}
201 | alps, bts, sam_label_list_test = sess.run([alphas, betas, sam_labels_test], feed_dict)
202 |
203 | # decode the obtained result
204 | gen_idxs, gen_labels = decode(sam_label_list_test, self.model.idx_to_label)
205 | org_idxs = label_idxs[:, 0]
206 |
207 | # show the result
208 | print('-------------------------------------------------------------')
209 | # write the compared result into a file
210 | for i in range(len(labels_batch)):
211 | txt_file.write(video_id_batch[i] + '-- org_label: ' + str(org_idxs[i]) + '--V.S.-- gen_label: '
212 | + str(gen_idxs[i]) + '\n')
213 |
214 | # save the match result
215 | MATCH_RESULT[video_id_batch[i]] = gen_idxs[i] - org_idxs[i]
216 |
217 | AP = accurate_percentage(gen_idxs, org_idxs)
218 | AP_ALL[iter] = float(AP)
219 | print(str(iter) + ' batch -- accurate percentage: ' + str(AP))
220 | percentage_txt.write(str(iter) + ' batch -- accurate percentage: ' + str(AP) + '\r\n')
221 |
222 | # closed writing of percentage_txt
223 | percentage_txt.write('\r\n')
224 | percentage_txt.write('accuracy: ' + str(np.mean(AP_ALL)) + '\r\n')
225 | percentage_txt.write('\r\n')
226 | percentage_txt.close()
227 |
228 | # closed writing of txt_file
229 | txt_file.write('\r\n')
230 | txt_file.write('accuracy: ' + str(np.mean(AP_ALL)) + '\r\n')
231 | txt_file.write('\r\n')
232 | txt_file.close()
233 |
234 | MATCH_RESULT['AP_ALL'] = AP_ALL
235 | AP_ALL.astype(np.float64)
236 | print('The total accurate percentage is ' + str(np.mean(AP_ALL)) + '\r\n')
237 | hickle.dump(MATCH_RESULT, test_result_save_path + 'MATCH_RESULT.hkl')
238 |
239 | # return np.mean(AP_ALL)
240 |
241 | # test all the model in validation set
242 | def all_model_val(self):
243 | txt = open(self.models_val_disp, 'a')
244 | txt.write(str(datetime.now()) + '\r\n')
245 | txt.write('\r\n')
246 |
247 | models_path = self.model_path
248 | models = [per for per in list(os.walk(models_path))[0][-1] if per != 'checkpoint' and per[-4::] != 'meta']
249 | models = sorted(models, cmp=model_comp)
250 |
251 | val_data = load_data(self.data_path, 'val')
252 | features = np.array(val_data['features'])
253 | labels = np.array(val_data['labels'])
254 | n_iterations = int(len(labels) / self.batch_size)
255 |
256 | # build a graph to sample labels
257 | alphas, betas, sam_labels_test = self.model.build_sampler()
258 |
259 | config = tf.ConfigProto(allow_soft_placement=True)
260 | config.gpu_options.allow_growth = True
261 | with tf.Session(config=config) as sess:
262 | saver = tf.train.Saver()
263 |
264 | # test each model in validation data set
265 | for cur_model in models:
266 | saver.restore(sess, self.model_path + cur_model)
267 | AP_ALL = 0
268 | for iter in range(n_iterations):
269 | S = iter * self.batch_size
270 | E = (iter + 1) * self.batch_size
271 | # batch-data
272 | features_batch = features[S:E]
273 | labels_batch = labels[S:E]
274 | # run the model
275 | label_idxs = np.array([[self.model.label_to_idx[per] for per in PER] for PER in labels_batch])
276 | feed_dict = {self.model.features: features_batch, self.model.label_idxs: label_idxs}
277 | alps, bts, sam_label_list_test = sess.run([alphas, betas, sam_labels_test], feed_dict)
278 | # decode the obtained result
279 | gen_idxs, gen_labels = decode(sam_label_list_test, self.model.idx_to_label)
280 | org_idxs = label_idxs[:, 0]
281 | AP = accurate_percentage(gen_idxs, org_idxs)
282 | AP_ALL += float(AP)
283 | print(cur_model + ': ' + str(round(AP_ALL / float(n_iterations), 4) * 100) + '%')
284 | txt.write(cur_model + ': ' + str(round(AP_ALL / float(n_iterations), 4) * 100) + '%' + '\r\n')
285 | txt.write('\r\n')
286 |
--------------------------------------------------------------------------------
/core/solver.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/core/solver.pyc
--------------------------------------------------------------------------------
/core/utils.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | import numpy as np
3 | import cPickle as pickle
4 | import time
5 | import collections
6 | import hickle
7 | import smtplib
8 | from email.mime.text import MIMEText
9 | from email.utils import formataddr
10 |
11 |
12 | # decode the result
13 | def decode(gen_label_list, idx_to_label):
14 | N = len(gen_label_list[0])
15 | labels_video = [None] * N
16 | label_idxs_video = [None] * N
17 | for j in range(N):
18 | possible_results = [label_t[j] for label_t in gen_label_list]
19 | temp = collections.Counter(possible_results).most_common()[0][0]
20 | label_idxs_video[j] = temp
21 | labels_video[j] = idx_to_label[temp]
22 | return np.array(label_idxs_video), np.array(labels_video)
23 |
24 |
25 | # calculate the AP
26 | def accurate_percentage(x, y):
27 | isSame = x - y
28 | return round(float(sum([1 for each in isSame if each == 0])) / float(len(x)), 4)
29 |
30 |
31 | def model_comp(x, y):
32 | num1 = int(x[x.find('-') + 1:])
33 | num2 = int(y[y.find('-') + 1:])
34 | if num1 > num2:
35 | return 1
36 | if num1 < num2:
37 | return -1
38 | if num1 == num2:
39 | return 0
40 |
41 |
42 | # load the train, val, test data set
43 | def load_data(data_path, split):
44 | start_t = time.time()
45 | features = hickle.load(data_path + split + '/' + 'features_' + split + '.hkl')
46 | labels = hickle.load(data_path + split + '/' + 'labels_all_' + split + '.hkl')
47 | video_ids = load_pickle(data_path + split + '/' + 'video_names_' + split + '.pkl') # name == id
48 | video_filename = load_pickle(data_path + split + '/' + 'video_filenames_' + split + '.pkl')
49 | data = {'features': features, 'labels': labels, 'video_ids': video_ids, 'video_filenames': video_filename}
50 | end_t = time.time()
51 | print "Elapse time: %.2f" % (end_t - start_t)
52 | return data
53 |
54 |
55 | # load pickle type data
56 | def load_pickle(path):
57 | with open(path, 'rb') as f:
58 | file = pickle.load(f)
59 | print ('Loaded %s..' % path)
60 | return file
61 |
62 |
63 | # save data in pickle
64 | def save_pickle(data, path):
65 | with open(path, 'wb') as f:
66 | pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
67 | print ('Saved %s..' % path)
68 |
69 |
70 | def Send_email(sender, user, theme, txt, password=".."):
71 | msg = MIMEText(txt, 'plain', 'utf-8')
72 | n = sender.find('@')
73 | m = user.find('@')
74 | msg['From'] = formataddr([sender[:n + 1], sender])
75 | msg['To'] = formataddr([user[:m + 1], user])
76 | msg['Subject'] = theme
77 |
78 | server = smtplib.SMTP("smtp-mail.***.com", 666)
79 | server.ehlo()
80 | server.starttls()
81 | server.login(sender, password)
82 | server.sendmail(sender, [user, ], msg.as_string())
83 | server.quit()
84 |
--------------------------------------------------------------------------------
/core/utils.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/core/utils.pyc
--------------------------------------------------------------------------------
/core/vggnet.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | import scipy.io
3 |
4 | vgg_layers = ['conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1',
5 | 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2',
6 | 'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'conv3_4', 'relu3_4', 'pool3',
7 | 'conv4_1', 'relu4_1', 'conv4_2', 'relu4_2', 'conv4_3', 'relu4_3', 'conv4_4', 'relu4_4', 'pool4',
8 | 'conv5_1', 'relu5_1', 'conv5_2', 'relu5_2', 'conv5_3', 'relu5_3', 'conv5_4', 'relu5_4']
9 |
10 |
11 | class Vgg19(object):
12 | def __init__(self, vgg_path):
13 | self.vgg_path = vgg_path
14 |
15 | def build_inputs(self):
16 | self.images = tf.placeholder(tf.float32, [None, 224, 224, 3], 'images')
17 |
18 | def build_params(self):
19 | model = scipy.io.loadmat(self.vgg_path)
20 | layers = model['layers'][0]
21 | self.params = {}
22 | with tf.variable_scope('encoder'):
23 | for i, layer in enumerate(layers):
24 | layer_name = layer[0][0][0][0]
25 | layer_type = layer[0][0][1][0]
26 | if layer_type == 'conv':
27 | w = layer[0][0][2][0][0].transpose(1, 0, 2, 3)
28 | b = layer[0][0][2][0][1].reshape(-1)
29 | self.params[layer_name] = {}
30 | self.params[layer_name]['w'] = tf.get_variable(layer_name + '/w', initializer=tf.constant(w))
31 | self.params[layer_name]['b'] = tf.get_variable(layer_name + '/b', initializer=tf.constant(b))
32 |
33 | def _conv(self, x, w, b):
34 | return tf.nn.bias_add(tf.nn.conv2d(x, w, strides=[1, 1, 1, 1], padding='SAME'), b)
35 |
36 | def _relu(self, x):
37 | return tf.nn.relu(x)
38 |
39 | def _pool(self, x):
40 | return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID')
41 |
42 | def build_model(self):
43 | for i, layer in enumerate(vgg_layers):
44 | layer_type = layer[:4]
45 | if layer_type == 'conv':
46 | if layer == 'conv1_1':
47 | h = self.images
48 | h = self._conv(h, self.params[layer]['w'], self.params[layer]['b'])
49 | elif layer_type == 'relu':
50 | h = self._relu(h)
51 | elif layer_type == 'pool':
52 | h = self._pool(h)
53 | if layer == 'conv5_3':
54 | self.features = tf.reshape(h, [-1, 196, 512])
55 |
56 | def build(self):
57 | self.build_inputs()
58 | self.build_params()
59 | self.build_model()
--------------------------------------------------------------------------------
/core/vggnet.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jingweio/Action_Recognition_using_Visual_Attention/6d82b2f6b97a07a374d7973bc286be3698f20d8c/core/vggnet.pyc
--------------------------------------------------------------------------------
/data/data_set/partition_distribution.txt:
--------------------------------------------------------------------------------
1 | 2017-08-15 18:12:58.442706
2 | train_partition_distribution:
3 | Total number: 889
4 | 1: 10.01%
5 | 2: 9.9%
6 | 3: 9.45%
7 | 4: 11.7%
8 | 5: 10.01%
9 | 6: 10.12%
10 | 7: 9.67%
11 | 8: 9.67%
12 | 9: 9.79%
13 | 10: 0.0%
14 |
15 | test_partition_distribution:
16 | Total number: 287
17 | 1: 10.1%
18 | 2: 9.76%
19 | 3: 9.76%
20 | 4: 11.85%
21 | 5: 10.1%
22 | 6: 10.1%
23 | 7: 9.41%
24 | 8: 9.41%
25 | 9: 10.1%
26 | 10: 0.0%
27 |
28 | val_partition_distribution:
29 | Total number: 299
30 | 1: 10.03%
31 | 2: 10.03%
32 | 3: 9.36%
33 | 4: 11.71%
34 | 5: 10.03%
35 | 6: 10.03%
36 | 7: 9.7%
37 | 8: 9.7%
38 | 9: 9.7%
39 | 10: 0.0%
40 |
41 |
--------------------------------------------------------------------------------
/data/data_set/test/detailed_record.txt:
--------------------------------------------------------------------------------
1 | 2017-08-15 18:10:23.723160_test_
2 | model path: /home/jingwei/Action Detection/A-R/data/model/lstm/model-330
3 |
4 | a12_v03_s07_e01-- org_label: 0--V.S.-- gen_label: 1
5 | a06_v01_s03_e03-- org_label: 6--V.S.-- gen_label: 6
6 | a11_v03_s10_e03-- org_label: 9--V.S.-- gen_label: 7
7 | a11_v01_s10_e01-- org_label: 9--V.S.-- gen_label: 1
8 | a12_v01_s02_e01-- org_label: 0--V.S.-- gen_label: 0
9 | a01_v02_s01_e03-- org_label: 1--V.S.-- gen_label: 5
10 | a09_v03_s08_e04-- org_label: 8--V.S.-- gen_label: 8
11 | a12_v01_s08_e04-- org_label: 0--V.S.-- gen_label: 0
12 | a03_v03_s03_e02-- org_label: 3--V.S.-- gen_label: 1
13 | a08_v01_s07_e01-- org_label: 7--V.S.-- gen_label: 7
14 | a08_v02_s10_e02-- org_label: 7--V.S.-- gen_label: 7
15 | a02_v01_s07_e04-- org_label: 2--V.S.-- gen_label: 2
16 | a08_v03_s03_e03-- org_label: 7--V.S.-- gen_label: 7
17 | a04_v02_s09_e03-- org_label: 4--V.S.-- gen_label: 4
18 | a01_v03_s03_e07-- org_label: 1--V.S.-- gen_label: 1
19 | a02_v01_s07_e05-- org_label: 2--V.S.-- gen_label: 1
20 | a08_v01_s03_e02-- org_label: 7--V.S.-- gen_label: 7
21 | a02_v02_s01_e03-- org_label: 2--V.S.-- gen_label: 5
22 | a02_v03_s08_e00-- org_label: 2--V.S.-- gen_label: 2
23 | a06_v02_s08_e00-- org_label: 6--V.S.-- gen_label: 6
24 | a08_v03_s03_e02-- org_label: 7--V.S.-- gen_label: 7
25 | a05_v03_s04_e01-- org_label: 5--V.S.-- gen_label: 5
26 | a03_v02_s10_e03-- org_label: 3--V.S.-- gen_label: 3
27 | a01_v01_s03_e00-- org_label: 1--V.S.-- gen_label: 1
28 | a08_v02_s05_e05-- org_label: 7--V.S.-- gen_label: 7
29 | a02_v02_s08_e03-- org_label: 2--V.S.-- gen_label: 5
30 | a12_v01_s03_e01-- org_label: 0--V.S.-- gen_label: 7
31 | a09_v02_s10_e03-- org_label: 8--V.S.-- gen_label: 8
32 | a11_v02_s05_e02-- org_label: 9--V.S.-- gen_label: 9
33 | a12_v02_s08_e04-- org_label: 0--V.S.-- gen_label: 0
34 | a02_v01_s05_e01-- org_label: 2--V.S.-- gen_label: 2
35 | a04_v01_s10_e02-- org_label: 4--V.S.-- gen_label: 1
36 | a02_v02_s09_e02-- org_label: 2--V.S.-- gen_label: 1
37 | a01_v02_s03_e03-- org_label: 1--V.S.-- gen_label: 1
38 | a09_v03_s01_e00-- org_label: 8--V.S.-- gen_label: 8
39 | a05_v01_s01_e01-- org_label: 5--V.S.-- gen_label: 5
40 | a02_v01_s02_e04-- org_label: 2--V.S.-- gen_label: 2
41 | a06_v02_s03_e00-- org_label: 6--V.S.-- gen_label: 6
42 | a01_v01_s08_e03-- org_label: 1--V.S.-- gen_label: 2
43 | a03_v03_s07_e01-- org_label: 3--V.S.-- gen_label: 4
44 | a09_v03_s04_e01-- org_label: 8--V.S.-- gen_label: 7
45 | a11_v01_s09_e01-- org_label: 9--V.S.-- gen_label: 9
46 | a05_v01_s07_e02-- org_label: 5--V.S.-- gen_label: 5
47 | a06_v03_s10_e01-- org_label: 6--V.S.-- gen_label: 6
48 | a06_v01_s10_e01-- org_label: 6--V.S.-- gen_label: 6
49 | a03_v01_s06_e04-- org_label: 3--V.S.-- gen_label: 9
50 | a02_v03_s01_e02-- org_label: 2--V.S.-- gen_label: 1
51 | a04_v03_s10_e02-- org_label: 4--V.S.-- gen_label: 0
52 | a01_v03_s09_e03-- org_label: 1--V.S.-- gen_label: 2
53 | a01_v02_s04_e00-- org_label: 1--V.S.-- gen_label: 1
54 | a11_v03_s07_e01-- org_label: 9--V.S.-- gen_label: 4
55 | a01_v03_s06_e03-- org_label: 1--V.S.-- gen_label: 2
56 | a06_v03_s09_e02-- org_label: 6--V.S.-- gen_label: 6
57 | a06_v03_s08_e01-- org_label: 6--V.S.-- gen_label: 6
58 | a05_v01_s02_e02-- org_label: 5--V.S.-- gen_label: 5
59 | a03_v01_s09_e02-- org_label: 3--V.S.-- gen_label: 5
60 | a01_v01_s02_e03-- org_label: 1--V.S.-- gen_label: 4
61 | a05_v02_s10_e00-- org_label: 5--V.S.-- gen_label: 2
62 | a09_v01_s07_e03-- org_label: 8--V.S.-- gen_label: 8
63 | a11_v02_s04_e02-- org_label: 9--V.S.-- gen_label: 3
64 | a09_v03_s02_e02-- org_label: 8--V.S.-- gen_label: 8
65 | a08_v01_s04_e02-- org_label: 7--V.S.-- gen_label: 7
66 | a12_v01_s07_e00-- org_label: 0--V.S.-- gen_label: 0
67 | a04_v03_s07_e03-- org_label: 4--V.S.-- gen_label: 4
68 | a08_v03_s10_e03-- org_label: 7--V.S.-- gen_label: 7
69 | a06_v03_s02_e02-- org_label: 6--V.S.-- gen_label: 6
70 | a01_v02_s06_e01-- org_label: 1--V.S.-- gen_label: 1
71 | a12_v01_s04_e04-- org_label: 0--V.S.-- gen_label: 0
72 | a02_v02_s08_e00-- org_label: 2--V.S.-- gen_label: 1
73 | a05_v01_s04_e04-- org_label: 5--V.S.-- gen_label: 5
74 | a06_v02_s05_e01-- org_label: 6--V.S.-- gen_label: 6
75 | a08_v03_s08_e03-- org_label: 7--V.S.-- gen_label: 7
76 | a08_v03_s08_e01-- org_label: 7--V.S.-- gen_label: 8
77 | a03_v02_s08_e02-- org_label: 3--V.S.-- gen_label: 2
78 | a03_v01_s03_e05-- org_label: 3--V.S.-- gen_label: 1
79 | a12_v01_s07_e02-- org_label: 0--V.S.-- gen_label: 0
80 | a03_v02_s07_e01-- org_label: 3--V.S.-- gen_label: 4
81 | a11_v03_s08_e00-- org_label: 9--V.S.-- gen_label: 9
82 | a03_v01_s10_e04-- org_label: 3--V.S.-- gen_label: 1
83 | a06_v03_s10_e02-- org_label: 6--V.S.-- gen_label: 6
84 | a02_v01_s09_e02-- org_label: 2--V.S.-- gen_label: 1
85 | a02_v03_s04_e00-- org_label: 2--V.S.-- gen_label: 1
86 | a09_v03_s06_e01-- org_label: 8--V.S.-- gen_label: 8
87 | a09_v02_s05_e02-- org_label: 8--V.S.-- gen_label: 8
88 | a09_v03_s03_e03-- org_label: 8--V.S.-- gen_label: 7
89 | a03_v03_s09_e01-- org_label: 3--V.S.-- gen_label: 3
90 | a09_v02_s01_e03-- org_label: 8--V.S.-- gen_label: 8
91 | a05_v03_s08_e00-- org_label: 5--V.S.-- gen_label: 5
92 | a08_v03_s08_e00-- org_label: 7--V.S.-- gen_label: 8
93 | a02_v03_s04_e01-- org_label: 2--V.S.-- gen_label: 1
94 | a09_v01_s06_e00-- org_label: 8--V.S.-- gen_label: 8
95 | a06_v01_s05_e04-- org_label: 6--V.S.-- gen_label: 6
96 | a09_v01_s03_e00-- org_label: 8--V.S.-- gen_label: 7
97 | a08_v01_s02_e00-- org_label: 7--V.S.-- gen_label: 8
98 | a09_v01_s01_e03-- org_label: 8--V.S.-- gen_label: 7
99 | a06_v02_s01_e01-- org_label: 6--V.S.-- gen_label: 6
100 | a04_v02_s09_e04-- org_label: 4--V.S.-- gen_label: 4
101 | a08_v01_s02_e04-- org_label: 7--V.S.-- gen_label: 7
102 | a12_v03_s02_e03-- org_label: 0--V.S.-- gen_label: 0
103 | a09_v02_s08_e04-- org_label: 8--V.S.-- gen_label: 8
104 | a06_v01_s07_e01-- org_label: 6--V.S.-- gen_label: 6
105 | a11_v02_s01_e02-- org_label: 9--V.S.-- gen_label: 9
106 | a08_v01_s05_e03-- org_label: 7--V.S.-- gen_label: 8
107 | a09_v02_s04_e01-- org_label: 8--V.S.-- gen_label: 7
108 | a05_v02_s10_e03-- org_label: 5--V.S.-- gen_label: 5
109 | a11_v02_s09_e00-- org_label: 9--V.S.-- gen_label: 9
110 | a06_v02_s04_e03-- org_label: 6--V.S.-- gen_label: 5
111 | a11_v02_s01_e00-- org_label: 9--V.S.-- gen_label: 9
112 | a12_v01_s10_e01-- org_label: 0--V.S.-- gen_label: 4
113 | a08_v01_s08_e01-- org_label: 7--V.S.-- gen_label: 7
114 | a11_v03_s04_e01-- org_label: 9--V.S.-- gen_label: 9
115 | a11_v02_s07_e01-- org_label: 9--V.S.-- gen_label: 4
116 | a11_v03_s06_e02-- org_label: 9--V.S.-- gen_label: 9
117 | a05_v03_s03_e04-- org_label: 5--V.S.-- gen_label: 5
118 | a01_v02_s08_e01-- org_label: 1--V.S.-- gen_label: 1
119 | a02_v01_s05_e04-- org_label: 2--V.S.-- gen_label: 2
120 | a02_v01_s10_e01-- org_label: 2--V.S.-- gen_label: 1
121 | a01_v01_s04_e02-- org_label: 1--V.S.-- gen_label: 1
122 | a02_v02_s09_e03-- org_label: 2--V.S.-- gen_label: 2
123 | a12_v02_s08_e01-- org_label: 0--V.S.-- gen_label: 0
124 | a01_v03_s10_e04-- org_label: 1--V.S.-- gen_label: 2
125 | a03_v03_s03_e04-- org_label: 3--V.S.-- gen_label: 1
126 | a05_v01_s03_e03-- org_label: 5--V.S.-- gen_label: 5
127 | a04_v02_s08_e00-- org_label: 4--V.S.-- gen_label: 9
128 | a01_v01_s08_e04-- org_label: 1--V.S.-- gen_label: 2
129 | a03_v01_s03_e00-- org_label: 3--V.S.-- gen_label: 3
130 | a08_v01_s05_e04-- org_label: 7--V.S.-- gen_label: 8
131 | a12_v02_s04_e05-- org_label: 0--V.S.-- gen_label: 4
132 | a03_v03_s02_e02-- org_label: 3--V.S.-- gen_label: 4
133 | a06_v03_s01_e03-- org_label: 6--V.S.-- gen_label: 6
134 | a11_v02_s09_e02-- org_label: 9--V.S.-- gen_label: 9
135 | a01_v01_s01_e02-- org_label: 1--V.S.-- gen_label: 9
136 | a11_v01_s02_e01-- org_label: 9--V.S.-- gen_label: 0
137 | a01_v02_s06_e04-- org_label: 1--V.S.-- gen_label: 2
138 | a05_v02_s06_e01-- org_label: 5--V.S.-- gen_label: 5
139 | a11_v02_s07_e00-- org_label: 9--V.S.-- gen_label: 3
140 | a03_v02_s05_e01-- org_label: 3--V.S.-- gen_label: 4
141 | a12_v02_s08_e03-- org_label: 0--V.S.-- gen_label: 6
142 | a04_v03_s10_e03-- org_label: 4--V.S.-- gen_label: 1
143 | a11_v02_s03_e00-- org_label: 9--V.S.-- gen_label: 0
144 | a08_v03_s01_e00-- org_label: 7--V.S.-- gen_label: 7
145 | a01_v01_s06_e00-- org_label: 1--V.S.-- gen_label: 2
146 | a12_v03_s06_e03-- org_label: 0--V.S.-- gen_label: 4
147 | a05_v01_s07_e01-- org_label: 5--V.S.-- gen_label: 5
148 | a09_v03_s10_e01-- org_label: 8--V.S.-- gen_label: 7
149 | a12_v01_s10_e04-- org_label: 0--V.S.-- gen_label: 7
150 | a05_v03_s04_e02-- org_label: 5--V.S.-- gen_label: 5
151 | a05_v01_s05_e01-- org_label: 5--V.S.-- gen_label: 5
152 | a11_v01_s09_e03-- org_label: 9--V.S.-- gen_label: 9
153 | a02_v02_s02_e00-- org_label: 2--V.S.-- gen_label: 2
154 | a04_v01_s01_e02-- org_label: 4--V.S.-- gen_label: 4
155 | a11_v01_s10_e00-- org_label: 9--V.S.-- gen_label: 1
156 | a05_v02_s09_e02-- org_label: 5--V.S.-- gen_label: 5
157 | a11_v02_s07_e02-- org_label: 9--V.S.-- gen_label: 4
158 | a11_v03_s03_e03-- org_label: 9--V.S.-- gen_label: 9
159 | a08_v02_s09_e03-- org_label: 7--V.S.-- gen_label: 7
160 | a03_v02_s05_e04-- org_label: 3--V.S.-- gen_label: 9
161 | a01_v02_s03_e04-- org_label: 1--V.S.-- gen_label: 1
162 | a12_v02_s01_e03-- org_label: 0--V.S.-- gen_label: 9
163 | a02_v01_s06_e01-- org_label: 2--V.S.-- gen_label: 2
164 | a04_v01_s04_e04-- org_label: 4--V.S.-- gen_label: 4
165 | a03_v01_s07_e01-- org_label: 3--V.S.-- gen_label: 9
166 | a02_v01_s04_e03-- org_label: 2--V.S.-- gen_label: 1
167 | a04_v02_s03_e00-- org_label: 4--V.S.-- gen_label: 0
168 | a11_v02_s04_e00-- org_label: 9--V.S.-- gen_label: 8
169 | a05_v03_s02_e01-- org_label: 5--V.S.-- gen_label: 5
170 | a12_v03_s06_e01-- org_label: 0--V.S.-- gen_label: 4
171 | a04_v01_s02_e03-- org_label: 4--V.S.-- gen_label: 4
172 | a01_v03_s09_e04-- org_label: 1--V.S.-- gen_label: 2
173 | a11_v01_s10_e03-- org_label: 9--V.S.-- gen_label: 0
174 | a03_v03_s02_e04-- org_label: 3--V.S.-- gen_label: 1
175 | a01_v03_s07_e02-- org_label: 1--V.S.-- gen_label: 2
176 | a03_v01_s02_e01-- org_label: 3--V.S.-- gen_label: 9
177 | a03_v02_s02_e03-- org_label: 3--V.S.-- gen_label: 9
178 | a03_v03_s06_e02-- org_label: 3--V.S.-- gen_label: 3
179 | a02_v01_s03_e02-- org_label: 2--V.S.-- gen_label: 2
180 | a12_v03_s04_e02-- org_label: 0--V.S.-- gen_label: 0
181 | a04_v01_s07_e02-- org_label: 4--V.S.-- gen_label: 8
182 | a02_v01_s06_e05-- org_label: 2--V.S.-- gen_label: 2
183 | a05_v03_s04_e00-- org_label: 5--V.S.-- gen_label: 5
184 | a09_v02_s01_e01-- org_label: 8--V.S.-- gen_label: 8
185 | a05_v01_s03_e01-- org_label: 5--V.S.-- gen_label: 6
186 | a06_v03_s10_e00-- org_label: 6--V.S.-- gen_label: 6
187 | a08_v01_s06_e03-- org_label: 7--V.S.-- gen_label: 8
188 | a12_v02_s02_e04-- org_label: 0--V.S.-- gen_label: 0
189 | a05_v03_s08_e03-- org_label: 5--V.S.-- gen_label: 5
190 | a03_v03_s04_e00-- org_label: 3--V.S.-- gen_label: 4
191 | a03_v02_s01_e02-- org_label: 3--V.S.-- gen_label: 6
192 | a05_v02_s07_e00-- org_label: 5--V.S.-- gen_label: 8
193 | a03_v01_s05_e02-- org_label: 3--V.S.-- gen_label: 4
194 | a02_v03_s10_e00-- org_label: 2--V.S.-- gen_label: 2
195 | a04_v01_s06_e02-- org_label: 4--V.S.-- gen_label: 4
196 | a04_v02_s01_e02-- org_label: 4--V.S.-- gen_label: 4
197 | a04_v02_s05_e04-- org_label: 4--V.S.-- gen_label: 4
198 | a06_v03_s01_e04-- org_label: 6--V.S.-- gen_label: 6
199 | a02_v01_s03_e00-- org_label: 2--V.S.-- gen_label: 3
200 | a09_v03_s01_e02-- org_label: 8--V.S.-- gen_label: 8
201 | a04_v03_s01_e03-- org_label: 4--V.S.-- gen_label: 4
202 | a06_v01_s04_e02-- org_label: 6--V.S.-- gen_label: 6
203 | a06_v01_s03_e04-- org_label: 6--V.S.-- gen_label: 6
204 | a03_v03_s09_e00-- org_label: 3--V.S.-- gen_label: 5
205 | a06_v01_s02_e02-- org_label: 6--V.S.-- gen_label: 6
206 | a04_v03_s01_e07-- org_label: 4--V.S.-- gen_label: 4
207 | a04_v02_s04_e02-- org_label: 4--V.S.-- gen_label: 4
208 | a08_v02_s03_e02-- org_label: 7--V.S.-- gen_label: 7
209 | a12_v03_s01_e03-- org_label: 0--V.S.-- gen_label: 0
210 | a01_v03_s07_e03-- org_label: 1--V.S.-- gen_label: 1
211 | a08_v02_s02_e01-- org_label: 7--V.S.-- gen_label: 7
212 | a09_v02_s09_e02-- org_label: 8--V.S.-- gen_label: 0
213 | a04_v03_s10_e00-- org_label: 4--V.S.-- gen_label: 0
214 | a09_v03_s04_e04-- org_label: 8--V.S.-- gen_label: 7
215 | a04_v02_s06_e00-- org_label: 4--V.S.-- gen_label: 9
216 | a04_v01_s06_e03-- org_label: 4--V.S.-- gen_label: 0
217 | a03_v01_s09_e04-- org_label: 3--V.S.-- gen_label: 4
218 | a09_v02_s04_e00-- org_label: 8--V.S.-- gen_label: 7
219 | a02_v03_s07_e01-- org_label: 2--V.S.-- gen_label: 1
220 | a12_v01_s01_e01-- org_label: 0--V.S.-- gen_label: 0
221 | a12_v02_s04_e03-- org_label: 0--V.S.-- gen_label: 5
222 | a01_v03_s04_e03-- org_label: 1--V.S.-- gen_label: 1
223 | a12_v02_s03_e00-- org_label: 0--V.S.-- gen_label: 0
224 | a04_v03_s09_e02-- org_label: 4--V.S.-- gen_label: 4
225 | a05_v02_s10_e04-- org_label: 5--V.S.-- gen_label: 5
226 | a11_v01_s05_e03-- org_label: 9--V.S.-- gen_label: 0
227 | a12_v02_s06_e04-- org_label: 0--V.S.-- gen_label: 0
228 | a01_v01_s10_e00-- org_label: 1--V.S.-- gen_label: 1
229 | a04_v03_s02_e03-- org_label: 4--V.S.-- gen_label: 4
230 | a04_v02_s02_e05-- org_label: 4--V.S.-- gen_label: 4
231 | a01_v02_s09_e03-- org_label: 1--V.S.-- gen_label: 5
232 | a09_v01_s06_e03-- org_label: 8--V.S.-- gen_label: 7
233 | a12_v01_s10_e00-- org_label: 0--V.S.-- gen_label: 7
234 | a01_v02_s05_e02-- org_label: 1--V.S.-- gen_label: 1
235 | a05_v03_s09_e00-- org_label: 5--V.S.-- gen_label: 5
236 | a08_v02_s07_e03-- org_label: 7--V.S.-- gen_label: 7
237 | a05_v03_s10_e03-- org_label: 5--V.S.-- gen_label: 5
238 | a04_v02_s09_e02-- org_label: 4--V.S.-- gen_label: 3
239 | a04_v01_s05_e04-- org_label: 4--V.S.-- gen_label: 4
240 | a11_v03_s01_e04-- org_label: 9--V.S.-- gen_label: 9
241 | a04_v03_s01_e04-- org_label: 4--V.S.-- gen_label: 4
242 | a04_v01_s01_e01-- org_label: 4--V.S.-- gen_label: 4
243 | a01_v02_s08_e00-- org_label: 1--V.S.-- gen_label: 2
244 | a04_v02_s06_e04-- org_label: 4--V.S.-- gen_label: 4
245 | a11_v01_s01_e04-- org_label: 9--V.S.-- gen_label: 9
246 | a06_v02_s07_e01-- org_label: 6--V.S.-- gen_label: 6
247 | a05_v01_s10_e02-- org_label: 5--V.S.-- gen_label: 5
248 | a02_v01_s06_e00-- org_label: 2--V.S.-- gen_label: 9
249 | a06_v03_s06_e02-- org_label: 6--V.S.-- gen_label: 6
250 | a06_v01_s02_e00-- org_label: 6--V.S.-- gen_label: 5
251 | a02_v01_s02_e01-- org_label: 2--V.S.-- gen_label: 1
252 | a01_v01_s06_e03-- org_label: 1--V.S.-- gen_label: 1
253 | a09_v01_s05_e06-- org_label: 8--V.S.-- gen_label: 9
254 | a09_v03_s02_e03-- org_label: 8--V.S.-- gen_label: 7
255 | a09_v03_s09_e03-- org_label: 8--V.S.-- gen_label: 8
256 | a04_v02_s02_e01-- org_label: 4--V.S.-- gen_label: 4
257 | a02_v01_s08_e04-- org_label: 2--V.S.-- gen_label: 2
258 | a08_v03_s08_e02-- org_label: 7--V.S.-- gen_label: 8
259 | a05_v03_s09_e02-- org_label: 5--V.S.-- gen_label: 5
260 | a05_v02_s07_e03-- org_label: 5--V.S.-- gen_label: 5
261 | a09_v03_s09_e00-- org_label: 8--V.S.-- gen_label: 7
262 | a04_v01_s04_e10-- org_label: 4--V.S.-- gen_label: 4
263 | a11_v02_s04_e01-- org_label: 9--V.S.-- gen_label: 4
264 | a04_v03_s09_e04-- org_label: 4--V.S.-- gen_label: 3
265 | a04_v02_s06_e02-- org_label: 4--V.S.-- gen_label: 2
266 | a06_v01_s02_e03-- org_label: 6--V.S.-- gen_label: 6
267 | a12_v01_s04_e05-- org_label: 0--V.S.-- gen_label: 0
268 | a08_v01_s06_e01-- org_label: 7--V.S.-- gen_label: 4
269 | a04_v02_s01_e01-- org_label: 4--V.S.-- gen_label: 8
270 | a06_v03_s10_e04-- org_label: 6--V.S.-- gen_label: 6
271 | a05_v01_s05_e02-- org_label: 5--V.S.-- gen_label: 5
272 | a06_v01_s10_e05-- org_label: 6--V.S.-- gen_label: 6
273 | a05_v02_s09_e04-- org_label: 5--V.S.-- gen_label: 5
274 | a12_v02_s03_e02-- org_label: 0--V.S.-- gen_label: 0
275 | a03_v02_s09_e04-- org_label: 3--V.S.-- gen_label: 1
276 | a02_v01_s04_e04-- org_label: 2--V.S.-- gen_label: 2
277 | a11_v01_s02_e00-- org_label: 9--V.S.-- gen_label: 0
278 | a01_v01_s01_e01-- org_label: 1--V.S.-- gen_label: 9
279 | a08_v03_s01_e02-- org_label: 7--V.S.-- gen_label: 7
280 | a01_v03_s06_e00-- org_label: 1--V.S.-- gen_label: 9
281 | a06_v02_s08_e03-- org_label: 6--V.S.-- gen_label: 6
282 | a03_v03_s10_e00-- org_label: 3--V.S.-- gen_label: 3
283 | a05_v03_s06_e00-- org_label: 5--V.S.-- gen_label: 5
284 | a06_v01_s04_e04-- org_label: 6--V.S.-- gen_label: 5
285 | a08_v01_s01_e04-- org_label: 7--V.S.-- gen_label: 7
286 | a11_v02_s01_e03-- org_label: 9--V.S.-- gen_label: 9
287 | a06_v01_s07_e04-- org_label: 6--V.S.-- gen_label: 6
288 | a08_v01_s08_e02-- org_label: 7--V.S.-- gen_label: 7
289 |
290 | accuracy: 0.582457894737
291 |
292 | 2017-08-15 18:13:23.862975_test_
293 | model path: /home/jingwei/Action Detection/A-R/data/model/lstm/model-430
294 |
295 | a12_v03_s07_e01-- org_label: 0--V.S.-- gen_label: 9
296 | a06_v01_s03_e03-- org_label: 6--V.S.-- gen_label: 6
297 | a11_v03_s10_e03-- org_label: 9--V.S.-- gen_label: 7
298 | a11_v01_s10_e01-- org_label: 9--V.S.-- gen_label: 3
299 | a12_v01_s02_e01-- org_label: 0--V.S.-- gen_label: 0
300 | a01_v02_s01_e03-- org_label: 1--V.S.-- gen_label: 6
301 | a09_v03_s08_e04-- org_label: 8--V.S.-- gen_label: 7
302 | a12_v01_s08_e04-- org_label: 0--V.S.-- gen_label: 0
303 | a03_v03_s03_e02-- org_label: 3--V.S.-- gen_label: 1
304 | a08_v01_s07_e01-- org_label: 7--V.S.-- gen_label: 7
305 | a08_v02_s10_e02-- org_label: 7--V.S.-- gen_label: 7
306 | a02_v01_s07_e04-- org_label: 2--V.S.-- gen_label: 2
307 | a08_v03_s03_e03-- org_label: 7--V.S.-- gen_label: 7
308 | a04_v02_s09_e03-- org_label: 4--V.S.-- gen_label: 3
309 | a01_v03_s03_e07-- org_label: 1--V.S.-- gen_label: 1
310 | a02_v01_s07_e05-- org_label: 2--V.S.-- gen_label: 2
311 | a08_v01_s03_e02-- org_label: 7--V.S.-- gen_label: 7
312 | a02_v02_s01_e03-- org_label: 2--V.S.-- gen_label: 5
313 | a02_v03_s08_e00-- org_label: 2--V.S.-- gen_label: 2
314 | a06_v02_s08_e00-- org_label: 6--V.S.-- gen_label: 6
315 | a08_v03_s03_e02-- org_label: 7--V.S.-- gen_label: 7
316 | a05_v03_s04_e01-- org_label: 5--V.S.-- gen_label: 5
317 | a03_v02_s10_e03-- org_label: 3--V.S.-- gen_label: 3
318 | a01_v01_s03_e00-- org_label: 1--V.S.-- gen_label: 1
319 | a08_v02_s05_e05-- org_label: 7--V.S.-- gen_label: 7
320 | a02_v02_s08_e03-- org_label: 2--V.S.-- gen_label: 5
321 | a12_v01_s03_e01-- org_label: 0--V.S.-- gen_label: 0
322 | a09_v02_s10_e03-- org_label: 8--V.S.-- gen_label: 5
323 | a11_v02_s05_e02-- org_label: 9--V.S.-- gen_label: 4
324 | a12_v02_s08_e04-- org_label: 0--V.S.-- gen_label: 0
325 | a02_v01_s05_e01-- org_label: 2--V.S.-- gen_label: 4
326 | a04_v01_s10_e02-- org_label: 4--V.S.-- gen_label: 3
327 | a02_v02_s09_e02-- org_label: 2--V.S.-- gen_label: 2
328 | a01_v02_s03_e03-- org_label: 1--V.S.-- gen_label: 1
329 | a09_v03_s01_e00-- org_label: 8--V.S.-- gen_label: 8
330 | a05_v01_s01_e01-- org_label: 5--V.S.-- gen_label: 5
331 | a02_v01_s02_e04-- org_label: 2--V.S.-- gen_label: 2
332 | a06_v02_s03_e00-- org_label: 6--V.S.-- gen_label: 6
333 | a01_v01_s08_e03-- org_label: 1--V.S.-- gen_label: 3
334 | a03_v03_s07_e01-- org_label: 3--V.S.-- gen_label: 3
335 | a09_v03_s04_e01-- org_label: 8--V.S.-- gen_label: 7
336 | a11_v01_s09_e01-- org_label: 9--V.S.-- gen_label: 0
337 | a05_v01_s07_e02-- org_label: 5--V.S.-- gen_label: 5
338 | a06_v03_s10_e01-- org_label: 6--V.S.-- gen_label: 6
339 | a06_v01_s10_e01-- org_label: 6--V.S.-- gen_label: 6
340 | a03_v01_s06_e04-- org_label: 3--V.S.-- gen_label: 9
341 | a02_v03_s01_e02-- org_label: 2--V.S.-- gen_label: 2
342 | a04_v03_s10_e02-- org_label: 4--V.S.-- gen_label: 4
343 | a01_v03_s09_e03-- org_label: 1--V.S.-- gen_label: 2
344 | a01_v02_s04_e00-- org_label: 1--V.S.-- gen_label: 1
345 | a11_v03_s07_e01-- org_label: 9--V.S.-- gen_label: 3
346 | a01_v03_s06_e03-- org_label: 1--V.S.-- gen_label: 2
347 | a06_v03_s09_e02-- org_label: 6--V.S.-- gen_label: 6
348 | a06_v03_s08_e01-- org_label: 6--V.S.-- gen_label: 6
349 | a05_v01_s02_e02-- org_label: 5--V.S.-- gen_label: 5
350 | a03_v01_s09_e02-- org_label: 3--V.S.-- gen_label: 1
351 | a01_v01_s02_e03-- org_label: 1--V.S.-- gen_label: 4
352 | a05_v02_s10_e00-- org_label: 5--V.S.-- gen_label: 2
353 | a09_v01_s07_e03-- org_label: 8--V.S.-- gen_label: 8
354 | a11_v02_s04_e02-- org_label: 9--V.S.-- gen_label: 3
355 | a09_v03_s02_e02-- org_label: 8--V.S.-- gen_label: 7
356 | a08_v01_s04_e02-- org_label: 7--V.S.-- gen_label: 7
357 | a12_v01_s07_e00-- org_label: 0--V.S.-- gen_label: 0
358 | a04_v03_s07_e03-- org_label: 4--V.S.-- gen_label: 3
359 | a08_v03_s10_e03-- org_label: 7--V.S.-- gen_label: 7
360 | a06_v03_s02_e02-- org_label: 6--V.S.-- gen_label: 6
361 | a01_v02_s06_e01-- org_label: 1--V.S.-- gen_label: 2
362 | a12_v01_s04_e04-- org_label: 0--V.S.-- gen_label: 0
363 | a02_v02_s08_e00-- org_label: 2--V.S.-- gen_label: 1
364 | a05_v01_s04_e04-- org_label: 5--V.S.-- gen_label: 6
365 | a06_v02_s05_e01-- org_label: 6--V.S.-- gen_label: 6
366 | a08_v03_s08_e03-- org_label: 7--V.S.-- gen_label: 7
367 | a08_v03_s08_e01-- org_label: 7--V.S.-- gen_label: 3
368 | a03_v02_s08_e02-- org_label: 3--V.S.-- gen_label: 2
369 | a03_v01_s03_e05-- org_label: 3--V.S.-- gen_label: 1
370 | a12_v01_s07_e02-- org_label: 0--V.S.-- gen_label: 0
371 | a03_v02_s07_e01-- org_label: 3--V.S.-- gen_label: 3
372 | a11_v03_s08_e00-- org_label: 9--V.S.-- gen_label: 3
373 | a03_v01_s10_e04-- org_label: 3--V.S.-- gen_label: 2
374 | a06_v03_s10_e02-- org_label: 6--V.S.-- gen_label: 6
375 | a02_v01_s09_e02-- org_label: 2--V.S.-- gen_label: 2
376 | a02_v03_s04_e00-- org_label: 2--V.S.-- gen_label: 2
377 | a09_v03_s06_e01-- org_label: 8--V.S.-- gen_label: 8
378 | a09_v02_s05_e02-- org_label: 8--V.S.-- gen_label: 8
379 | a09_v03_s03_e03-- org_label: 8--V.S.-- gen_label: 8
380 | a03_v03_s09_e01-- org_label: 3--V.S.-- gen_label: 3
381 | a09_v02_s01_e03-- org_label: 8--V.S.-- gen_label: 8
382 | a05_v03_s08_e00-- org_label: 5--V.S.-- gen_label: 5
383 | a08_v03_s08_e00-- org_label: 7--V.S.-- gen_label: 3
384 | a02_v03_s04_e01-- org_label: 2--V.S.-- gen_label: 2
385 | a09_v01_s06_e00-- org_label: 8--V.S.-- gen_label: 8
386 | a06_v01_s05_e04-- org_label: 6--V.S.-- gen_label: 6
387 | a09_v01_s03_e00-- org_label: 8--V.S.-- gen_label: 8
388 | a08_v01_s02_e00-- org_label: 7--V.S.-- gen_label: 7
389 | a09_v01_s01_e03-- org_label: 8--V.S.-- gen_label: 8
390 | a06_v02_s01_e01-- org_label: 6--V.S.-- gen_label: 6
391 | a04_v02_s09_e04-- org_label: 4--V.S.-- gen_label: 4
392 | a08_v01_s02_e04-- org_label: 7--V.S.-- gen_label: 7
393 | a12_v03_s02_e03-- org_label: 0--V.S.-- gen_label: 0
394 | a09_v02_s08_e04-- org_label: 8--V.S.-- gen_label: 8
395 | a06_v01_s07_e01-- org_label: 6--V.S.-- gen_label: 6
396 | a11_v02_s01_e02-- org_label: 9--V.S.-- gen_label: 9
397 | a08_v01_s05_e03-- org_label: 7--V.S.-- gen_label: 7
398 | a09_v02_s04_e01-- org_label: 8--V.S.-- gen_label: 7
399 | a05_v02_s10_e03-- org_label: 5--V.S.-- gen_label: 5
400 | a11_v02_s09_e00-- org_label: 9--V.S.-- gen_label: 9
401 | a06_v02_s04_e03-- org_label: 6--V.S.-- gen_label: 5
402 | a11_v02_s01_e00-- org_label: 9--V.S.-- gen_label: 9
403 | a12_v01_s10_e01-- org_label: 0--V.S.-- gen_label: 9
404 | a08_v01_s08_e01-- org_label: 7--V.S.-- gen_label: 7
405 | a11_v03_s04_e01-- org_label: 9--V.S.-- gen_label: 4
406 | a11_v02_s07_e01-- org_label: 9--V.S.-- gen_label: 9
407 | a11_v03_s06_e02-- org_label: 9--V.S.-- gen_label: 9
408 | a05_v03_s03_e04-- org_label: 5--V.S.-- gen_label: 5
409 | a01_v02_s08_e01-- org_label: 1--V.S.-- gen_label: 1
410 | a02_v01_s05_e04-- org_label: 2--V.S.-- gen_label: 2
411 | a02_v01_s10_e01-- org_label: 2--V.S.-- gen_label: 2
412 | a01_v01_s04_e02-- org_label: 1--V.S.-- gen_label: 9
413 | a02_v02_s09_e03-- org_label: 2--V.S.-- gen_label: 2
414 | a12_v02_s08_e01-- org_label: 0--V.S.-- gen_label: 0
415 | a01_v03_s10_e04-- org_label: 1--V.S.-- gen_label: 2
416 | a03_v03_s03_e04-- org_label: 3--V.S.-- gen_label: 1
417 | a05_v01_s03_e03-- org_label: 5--V.S.-- gen_label: 5
418 | a04_v02_s08_e00-- org_label: 4--V.S.-- gen_label: 4
419 | a01_v01_s08_e04-- org_label: 1--V.S.-- gen_label: 2
420 | a03_v01_s03_e00-- org_label: 3--V.S.-- gen_label: 3
421 | a08_v01_s05_e04-- org_label: 7--V.S.-- gen_label: 4
422 | a12_v02_s04_e05-- org_label: 0--V.S.-- gen_label: 0
423 | a03_v03_s02_e02-- org_label: 3--V.S.-- gen_label: 4
424 | a06_v03_s01_e03-- org_label: 6--V.S.-- gen_label: 6
425 | a11_v02_s09_e02-- org_label: 9--V.S.-- gen_label: 9
426 | a01_v01_s01_e02-- org_label: 1--V.S.-- gen_label: 2
427 | a11_v01_s02_e01-- org_label: 9--V.S.-- gen_label: 9
428 | a01_v02_s06_e04-- org_label: 1--V.S.-- gen_label: 2
429 | a05_v02_s06_e01-- org_label: 5--V.S.-- gen_label: 5
430 | a11_v02_s07_e00-- org_label: 9--V.S.-- gen_label: 8
431 | a03_v02_s05_e01-- org_label: 3--V.S.-- gen_label: 8
432 | a12_v02_s08_e03-- org_label: 0--V.S.-- gen_label: 4
433 | a04_v03_s10_e03-- org_label: 4--V.S.-- gen_label: 8
434 | a11_v02_s03_e00-- org_label: 9--V.S.-- gen_label: 3
435 | a08_v03_s01_e00-- org_label: 7--V.S.-- gen_label: 7
436 | a01_v01_s06_e00-- org_label: 1--V.S.-- gen_label: 3
437 | a12_v03_s06_e03-- org_label: 0--V.S.-- gen_label: 9
438 | a05_v01_s07_e01-- org_label: 5--V.S.-- gen_label: 6
439 | a09_v03_s10_e01-- org_label: 8--V.S.-- gen_label: 8
440 | a12_v01_s10_e04-- org_label: 0--V.S.-- gen_label: 7
441 | a05_v03_s04_e02-- org_label: 5--V.S.-- gen_label: 5
442 | a05_v01_s05_e01-- org_label: 5--V.S.-- gen_label: 5
443 | a11_v01_s09_e03-- org_label: 9--V.S.-- gen_label: 9
444 | a02_v02_s02_e00-- org_label: 2--V.S.-- gen_label: 2
445 | a04_v01_s01_e02-- org_label: 4--V.S.-- gen_label: 4
446 | a11_v01_s10_e00-- org_label: 9--V.S.-- gen_label: 2
447 | a05_v02_s09_e02-- org_label: 5--V.S.-- gen_label: 5
448 | a11_v02_s07_e02-- org_label: 9--V.S.-- gen_label: 0
449 | a11_v03_s03_e03-- org_label: 9--V.S.-- gen_label: 9
450 | a08_v02_s09_e03-- org_label: 7--V.S.-- gen_label: 7
451 | a03_v02_s05_e04-- org_label: 3--V.S.-- gen_label: 1
452 | a01_v02_s03_e04-- org_label: 1--V.S.-- gen_label: 1
453 | a12_v02_s01_e03-- org_label: 0--V.S.-- gen_label: 9
454 | a02_v01_s06_e01-- org_label: 2--V.S.-- gen_label: 3
455 | a04_v01_s04_e04-- org_label: 4--V.S.-- gen_label: 4
456 | a03_v01_s07_e01-- org_label: 3--V.S.-- gen_label: 3
457 | a02_v01_s04_e03-- org_label: 2--V.S.-- gen_label: 2
458 | a04_v02_s03_e00-- org_label: 4--V.S.-- gen_label: 4
459 | a11_v02_s04_e00-- org_label: 9--V.S.-- gen_label: 3
460 | a05_v03_s02_e01-- org_label: 5--V.S.-- gen_label: 5
461 | a12_v03_s06_e01-- org_label: 0--V.S.-- gen_label: 0
462 | a04_v01_s02_e03-- org_label: 4--V.S.-- gen_label: 0
463 | a01_v03_s09_e04-- org_label: 1--V.S.-- gen_label: 2
464 | a11_v01_s10_e03-- org_label: 9--V.S.-- gen_label: 0
465 | a03_v03_s02_e04-- org_label: 3--V.S.-- gen_label: 3
466 | a01_v03_s07_e02-- org_label: 1--V.S.-- gen_label: 2
467 | a03_v01_s02_e01-- org_label: 3--V.S.-- gen_label: 2
468 | a03_v02_s02_e03-- org_label: 3--V.S.-- gen_label: 2
469 | a03_v03_s06_e02-- org_label: 3--V.S.-- gen_label: 3
470 | a02_v01_s03_e02-- org_label: 2--V.S.-- gen_label: 2
471 | a12_v03_s04_e02-- org_label: 0--V.S.-- gen_label: 4
472 | a04_v01_s07_e02-- org_label: 4--V.S.-- gen_label: 4
473 | a02_v01_s06_e05-- org_label: 2--V.S.-- gen_label: 2
474 | a05_v03_s04_e00-- org_label: 5--V.S.-- gen_label: 5
475 | a09_v02_s01_e01-- org_label: 8--V.S.-- gen_label: 8
476 | a05_v01_s03_e01-- org_label: 5--V.S.-- gen_label: 6
477 | a06_v03_s10_e00-- org_label: 6--V.S.-- gen_label: 6
478 | a08_v01_s06_e03-- org_label: 7--V.S.-- gen_label: 8
479 | a12_v02_s02_e04-- org_label: 0--V.S.-- gen_label: 0
480 | a05_v03_s08_e03-- org_label: 5--V.S.-- gen_label: 5
481 | a03_v03_s04_e00-- org_label: 3--V.S.-- gen_label: 9
482 | a03_v02_s01_e02-- org_label: 3--V.S.-- gen_label: 1
483 | a05_v02_s07_e00-- org_label: 5--V.S.-- gen_label: 6
484 | a03_v01_s05_e02-- org_label: 3--V.S.-- gen_label: 4
485 | a02_v03_s10_e00-- org_label: 2--V.S.-- gen_label: 2
486 | a04_v01_s06_e02-- org_label: 4--V.S.-- gen_label: 4
487 | a04_v02_s01_e02-- org_label: 4--V.S.-- gen_label: 4
488 | a04_v02_s05_e04-- org_label: 4--V.S.-- gen_label: 4
489 | a06_v03_s01_e04-- org_label: 6--V.S.-- gen_label: 6
490 | a02_v01_s03_e00-- org_label: 2--V.S.-- gen_label: 3
491 | a09_v03_s01_e02-- org_label: 8--V.S.-- gen_label: 7
492 | a04_v03_s01_e03-- org_label: 4--V.S.-- gen_label: 3
493 | a06_v01_s04_e02-- org_label: 6--V.S.-- gen_label: 6
494 | a06_v01_s03_e04-- org_label: 6--V.S.-- gen_label: 6
495 | a03_v03_s09_e00-- org_label: 3--V.S.-- gen_label: 4
496 | a06_v01_s02_e02-- org_label: 6--V.S.-- gen_label: 6
497 | a04_v03_s01_e07-- org_label: 4--V.S.-- gen_label: 4
498 | a04_v02_s04_e02-- org_label: 4--V.S.-- gen_label: 4
499 | a08_v02_s03_e02-- org_label: 7--V.S.-- gen_label: 7
500 | a12_v03_s01_e03-- org_label: 0--V.S.-- gen_label: 0
501 | a01_v03_s07_e03-- org_label: 1--V.S.-- gen_label: 2
502 | a08_v02_s02_e01-- org_label: 7--V.S.-- gen_label: 7
503 | a09_v02_s09_e02-- org_label: 8--V.S.-- gen_label: 0
504 | a04_v03_s10_e00-- org_label: 4--V.S.-- gen_label: 0
505 | a09_v03_s04_e04-- org_label: 8--V.S.-- gen_label: 7
506 | a04_v02_s06_e00-- org_label: 4--V.S.-- gen_label: 9
507 | a04_v01_s06_e03-- org_label: 4--V.S.-- gen_label: 3
508 | a03_v01_s09_e04-- org_label: 3--V.S.-- gen_label: 3
509 | a09_v02_s04_e00-- org_label: 8--V.S.-- gen_label: 7
510 | a02_v03_s07_e01-- org_label: 2--V.S.-- gen_label: 2
511 | a12_v01_s01_e01-- org_label: 0--V.S.-- gen_label: 3
512 | a12_v02_s04_e03-- org_label: 0--V.S.-- gen_label: 3
513 | a01_v03_s04_e03-- org_label: 1--V.S.-- gen_label: 1
514 | a12_v02_s03_e00-- org_label: 0--V.S.-- gen_label: 3
515 | a04_v03_s09_e02-- org_label: 4--V.S.-- gen_label: 2
516 | a05_v02_s10_e04-- org_label: 5--V.S.-- gen_label: 1
517 | a11_v01_s05_e03-- org_label: 9--V.S.-- gen_label: 0
518 | a12_v02_s06_e04-- org_label: 0--V.S.-- gen_label: 9
519 | a01_v01_s10_e00-- org_label: 1--V.S.-- gen_label: 2
520 | a04_v03_s02_e03-- org_label: 4--V.S.-- gen_label: 4
521 | a04_v02_s02_e05-- org_label: 4--V.S.-- gen_label: 4
522 | a01_v02_s09_e03-- org_label: 1--V.S.-- gen_label: 1
523 | a09_v01_s06_e03-- org_label: 8--V.S.-- gen_label: 7
524 | a12_v01_s10_e00-- org_label: 0--V.S.-- gen_label: 3
525 | a01_v02_s05_e02-- org_label: 1--V.S.-- gen_label: 1
526 | a05_v03_s09_e00-- org_label: 5--V.S.-- gen_label: 5
527 | a08_v02_s07_e03-- org_label: 7--V.S.-- gen_label: 7
528 | a05_v03_s10_e03-- org_label: 5--V.S.-- gen_label: 5
529 | a04_v02_s09_e02-- org_label: 4--V.S.-- gen_label: 5
530 | a04_v01_s05_e04-- org_label: 4--V.S.-- gen_label: 4
531 | a11_v03_s01_e04-- org_label: 9--V.S.-- gen_label: 9
532 | a04_v03_s01_e04-- org_label: 4--V.S.-- gen_label: 3
533 | a04_v01_s01_e01-- org_label: 4--V.S.-- gen_label: 3
534 | a01_v02_s08_e00-- org_label: 1--V.S.-- gen_label: 1
535 | a04_v02_s06_e04-- org_label: 4--V.S.-- gen_label: 3
536 | a11_v01_s01_e04-- org_label: 9--V.S.-- gen_label: 9
537 | a06_v02_s07_e01-- org_label: 6--V.S.-- gen_label: 6
538 | a05_v01_s10_e02-- org_label: 5--V.S.-- gen_label: 5
539 | a02_v01_s06_e00-- org_label: 2--V.S.-- gen_label: 9
540 | a06_v03_s06_e02-- org_label: 6--V.S.-- gen_label: 6
541 | a06_v01_s02_e00-- org_label: 6--V.S.-- gen_label: 5
542 | a02_v01_s02_e01-- org_label: 2--V.S.-- gen_label: 2
543 | a01_v01_s06_e03-- org_label: 1--V.S.-- gen_label: 1
544 | a09_v01_s05_e06-- org_label: 8--V.S.-- gen_label: 0
545 | a09_v03_s02_e03-- org_label: 8--V.S.-- gen_label: 7
546 | a09_v03_s09_e03-- org_label: 8--V.S.-- gen_label: 8
547 | a04_v02_s02_e01-- org_label: 4--V.S.-- gen_label: 4
548 | a02_v01_s08_e04-- org_label: 2--V.S.-- gen_label: 2
549 | a08_v03_s08_e02-- org_label: 7--V.S.-- gen_label: 8
550 | a05_v03_s09_e02-- org_label: 5--V.S.-- gen_label: 5
551 | a05_v02_s07_e03-- org_label: 5--V.S.-- gen_label: 5
552 | a09_v03_s09_e00-- org_label: 8--V.S.-- gen_label: 8
553 | a04_v01_s04_e10-- org_label: 4--V.S.-- gen_label: 9
554 | a11_v02_s04_e01-- org_label: 9--V.S.-- gen_label: 4
555 | a04_v03_s09_e04-- org_label: 4--V.S.-- gen_label: 3
556 | a04_v02_s06_e02-- org_label: 4--V.S.-- gen_label: 2
557 | a06_v01_s02_e03-- org_label: 6--V.S.-- gen_label: 6
558 | a12_v01_s04_e05-- org_label: 0--V.S.-- gen_label: 3
559 | a08_v01_s06_e01-- org_label: 7--V.S.-- gen_label: 7
560 | a04_v02_s01_e01-- org_label: 4--V.S.-- gen_label: 4
561 | a06_v03_s10_e04-- org_label: 6--V.S.-- gen_label: 6
562 | a05_v01_s05_e02-- org_label: 5--V.S.-- gen_label: 5
563 | a06_v01_s10_e05-- org_label: 6--V.S.-- gen_label: 6
564 | a05_v02_s09_e04-- org_label: 5--V.S.-- gen_label: 5
565 | a12_v02_s03_e02-- org_label: 0--V.S.-- gen_label: 0
566 | a03_v02_s09_e04-- org_label: 3--V.S.-- gen_label: 3
567 | a02_v01_s04_e04-- org_label: 2--V.S.-- gen_label: 2
568 | a11_v01_s02_e00-- org_label: 9--V.S.-- gen_label: 0
569 | a01_v01_s01_e01-- org_label: 1--V.S.-- gen_label: 3
570 | a08_v03_s01_e02-- org_label: 7--V.S.-- gen_label: 7
571 | a01_v03_s06_e00-- org_label: 1--V.S.-- gen_label: 1
572 | a06_v02_s08_e03-- org_label: 6--V.S.-- gen_label: 6
573 | a03_v03_s10_e00-- org_label: 3--V.S.-- gen_label: 0
574 | a05_v03_s06_e00-- org_label: 5--V.S.-- gen_label: 5
575 | a06_v01_s04_e04-- org_label: 6--V.S.-- gen_label: 6
576 | a08_v01_s01_e04-- org_label: 7--V.S.-- gen_label: 8
577 | a11_v02_s01_e03-- org_label: 9--V.S.-- gen_label: 9
578 | a06_v01_s07_e04-- org_label: 6--V.S.-- gen_label: 6
579 | a08_v01_s08_e02-- org_label: 7--V.S.-- gen_label: 7
580 |
581 | accuracy: 0.599994736842
582 |
583 |
--------------------------------------------------------------------------------
/data/data_set/test/percentage record.txt:
--------------------------------------------------------------------------------
1 | 2017-08-15 18:10:23.723128_test_
2 | model path: /home/jingwei/Action Detection/A-R/data/model/lstm/model-330
3 |
4 | 0 batch -- accurate percentage: 0.6667
5 | 1 batch -- accurate percentage: 0.7333
6 | 2 batch -- accurate percentage: 0.6667
7 | 3 batch -- accurate percentage: 0.3333
8 | 4 batch -- accurate percentage: 0.7333
9 | 5 batch -- accurate percentage: 0.5333
10 | 6 batch -- accurate percentage: 0.6667
11 | 7 batch -- accurate percentage: 0.7333
12 | 8 batch -- accurate percentage: 0.3333
13 | 9 batch -- accurate percentage: 0.4
14 | 10 batch -- accurate percentage: 0.4667
15 | 11 batch -- accurate percentage: 0.4667
16 | 12 batch -- accurate percentage: 0.6
17 | 13 batch -- accurate percentage: 0.7333
18 | 14 batch -- accurate percentage: 0.4667
19 | 15 batch -- accurate percentage: 0.6667
20 | 16 batch -- accurate percentage: 0.6
21 | 17 batch -- accurate percentage: 0.6
22 | 18 batch -- accurate percentage: 0.6667
23 |
24 | accuracy: 0.582457894737
25 |
26 | 2017-08-15 18:13:23.862936_test_
27 | model path: /home/jingwei/Action Detection/A-R/data/model/lstm/model-430
28 |
29 | 0 batch -- accurate percentage: 0.5333
30 | 1 batch -- accurate percentage: 0.7333
31 | 2 batch -- accurate percentage: 0.6667
32 | 3 batch -- accurate percentage: 0.4667
33 | 4 batch -- accurate percentage: 0.4667
34 | 5 batch -- accurate percentage: 0.8
35 | 6 batch -- accurate percentage: 0.9333
36 | 7 batch -- accurate percentage: 0.7333
37 | 8 batch -- accurate percentage: 0.5333
38 | 9 batch -- accurate percentage: 0.4
39 | 10 batch -- accurate percentage: 0.6
40 | 11 batch -- accurate percentage: 0.5333
41 | 12 batch -- accurate percentage: 0.6
42 | 13 batch -- accurate percentage: 0.5333
43 | 14 batch -- accurate percentage: 0.2
44 | 15 batch -- accurate percentage: 0.6667
45 | 16 batch -- accurate percentage: 0.6
46 | 17 batch -- accurate percentage: 0.6667
47 | 18 batch -- accurate percentage: 0.7333
48 |
49 | accuracy: 0.599994736842
50 |
51 |
--------------------------------------------------------------------------------
/data/data_set/test/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/data/data_set/train/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/data/data_set/val/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/data/image/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/data/log/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/data/model/models_accuracy_val.txt:
--------------------------------------------------------------------------------
1 | 2017-08-14 20:31:54.062158
2 |
3 | model-10: 15.44%
4 | model-20: 23.16%
5 | model-30: 39.3%
6 | model-40: 39.3%
7 | model-50: 45.61%
8 | model-60: 49.82%
9 | model-70: 51.93%
10 | model-80: 52.28%
11 | model-90: 51.93%
12 | model-100: 46.67%
13 | model-110: 55.09%
14 | model-120: 57.19%
15 | model-130: 53.69%
16 | model-140: 57.19%
17 | model-150: 55.79%
18 | model-160: 59.65%
19 | model-170: 54.04%
20 | model-180: 55.79%
21 | model-190: 56.49%
22 | model-200: 57.89%
23 | model-210: 56.14%
24 | model-220: 60.0%
25 | model-230: 52.63%
26 | model-240: 54.39%
27 | model-250: 55.09%
28 | model-260: 57.89%
29 | model-270: 56.49%
30 | model-280: 58.95%
31 | model-290: 52.63%
32 | model-300: 57.54%
33 | model-310: 60.35%
34 | model-320: 55.79%
35 | model-330: 61.4%
36 | model-340: 60.7%
37 | model-350: 60.7%
38 | model-360: 54.74%
39 | model-370: 58.95%
40 | model-380: 59.65%
41 | model-390: 58.25%
42 | model-400: 58.25%
43 | model-410: 61.75%
44 | model-420: 59.65%
45 | model-430: 63.16%
46 | model-440: 37.19%
47 | model-450: 58.25%
48 | model-460: 56.84%
49 | model-470: 56.49%
50 | model-480: 58.95%
51 | model-490: 55.09%
52 | model-500: 51.93%
53 |
54 |
--------------------------------------------------------------------------------
/data/model/readme:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pre-data.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | from core.utils import *
3 | import os
4 | import subprocess
5 | import numpy as np
6 |
7 |
8 | # seprate the whole data into train, val, and test set
9 | def seprate_data(folders, read_path, save_path):
10 | attributes = ['video_names', 'labels', 'video_filenames']
11 | sets = ['train', 'val', 'test']
12 |
13 | # build necessary variables
14 | for attr in attributes:
15 | for s in sets:
16 | exec (attr + '_' + s + '=[]')
17 |
18 | # process in each folder
19 | for each in folders:
20 | path = read_path + each + '/'
21 |
22 | video_names = load_pickle(path + each + '_video_names.pkl')
23 | label = load_pickle(path + each + '_label.pkl')
24 | number = len(video_names)
25 |
26 | Video_Filenames = [path + per + '/' for per in video_names] # video_filenames
27 | Video_Names = [each + '_' + name for name in video_names] # VideoIds
28 | Labels = [label] * number # labels
29 |
30 | # inside_mix up -- different people's mixing up
31 | Labels, Video_Filenames, Video_Names = mix_up(Labels, Video_Filenames, Video_Names)
32 |
33 | # list_lization
34 | Labels = list(Labels)
35 | Video_Filenames = list(Video_Filenames)
36 | Video_Names = list(Video_Names)
37 |
38 | # 0.6:0.20:0.20 distributed on the sets including train, val, and test sets
39 | n1 = int(np.ceil(number * 0.6))
40 | n2 = int(np.ceil(number * 0.20))
41 |
42 | print(str(number) + ' ' + str(n1) + ' ' + str(n2))
43 | print('label: ' + label)
44 |
45 | # video names
46 | video_names_train += Video_Names[:n1]
47 | video_names_val += Video_Names[n1:n1 + n2]
48 | video_names_test += Video_Names[n1 + n2:]
49 |
50 | # labels
51 | labels_train += Labels[:n1]
52 | labels_val += Labels[n1:n1 + n2]
53 | labels_test += Labels[n1 + n2:]
54 |
55 | # video_filenames
56 | video_filenames_train += Video_Filenames[:n1]
57 | video_filenames_val += Video_Filenames[n1:n1 + n2]
58 | video_filenames_test += Video_Filenames[n1 + n2:]
59 |
60 | # train_mix up
61 | video_names_train, labels_train, video_filenames_train = mix_up(video_names_train, labels_train,
62 | video_filenames_train)
63 | # validation_mix up
64 | video_names_val, labels_val, video_filenames_val = mix_up(video_names_val, labels_val, video_filenames_val)
65 | # test_mix up
66 | video_names_test, labels_test, video_filenames_test = mix_up(video_names_test, labels_test, video_filenames_test)
67 |
68 | # create folders:
69 | if not os.path.exists(save_path + 'train/'):
70 | os.makedirs(save_path + 'train/')
71 | if not os.path.exists(save_path + 'test/'):
72 | os.makedirs(save_path + 'test/')
73 | if not os.path.exists(save_path + 'val/'):
74 | os.makedirs(save_path + 'val/')
75 |
76 | # save video_names
77 | save_pickle(video_names_train, save_path + 'train/' + 'video_names_train.pkl')
78 | save_pickle(video_names_val, save_path + 'val/' + 'video_names_val.pkl')
79 | save_pickle(video_names_test, save_path + 'test/' + 'video_names_test.pkl')
80 | # save labels
81 | save_pickle(labels_train, save_path + 'train/' + 'labels_train.pkl')
82 | save_pickle(labels_val, save_path + 'val/' + 'labels_val.pkl')
83 | save_pickle(labels_test, save_path + 'test/' + 'labels_test.pkl')
84 | # save video_filenames
85 | save_pickle(video_filenames_train, save_path + 'train/' + 'video_filenames_train.pkl')
86 | save_pickle(video_filenames_val, save_path + 'val/' + 'video_filenames_val.pkl')
87 | save_pickle(video_filenames_test, save_path + 'test/' + 'video_filenames_test.pkl')
88 |
89 |
90 | def video2image(rpath, spath, n):
91 | # '-r ' + str(n) +
92 | strcmd = 'ffmpeg -i ' + '"' + rpath + '"' + ' -vframes ' + str(
93 | n) + ' -s 224*224 -f image2 ' + '"' + spath + '%d.jpg"'
94 | subprocess.call(strcmd, shell=True)
95 |
96 |
97 | # def scan_folder(path):
98 | # return len(list(os.walk(path))[0][1])
99 |
100 |
101 | # mix up the order of the items in x, y and z separately
102 | def mix_up(x, y, z):
103 | x = np.array(x)
104 | y = np.array(y)
105 | z = np.array(z)
106 | n = len(x)
107 | rand_idxs = np.random.permutation(n)
108 | x = x[rand_idxs]
109 | y = y[rand_idxs]
110 | z = z[rand_idxs]
111 | return x, y, z
112 |
113 |
114 | def main():
115 | video_path = '/home/jingwei/Action Detection/video-ucla-website/'
116 | data_path = '/home/jingwei/Action Detection/A-R/data/'
117 | folders = ['a01', 'a02', 'a03', 'a04', 'a05', 'a06', 'a08', 'a09', 'a11', 'a12']
118 |
119 | # folder-type to label
120 | video_labels_dic = {'a01': 'pick up with one hand',
121 | 'a02': 'pick up with two hands',
122 | 'a03': 'drop trash',
123 | 'a04': 'walk around',
124 | 'a05': 'sit down',
125 | 'a06': 'stand up',
126 | 'a08': 'donning',
127 | 'a09': 'doffing',
128 | 'a11': 'throw',
129 | 'a12': 'carry'}
130 | for type in folders:
131 | cur_video_path = video_path + type + '/'
132 | cur_image_path = data_path + 'image/' + type + '/'
133 |
134 | # obtain the label of videos
135 | try:
136 | label = open(cur_video_path + 'label-' + type + '.txt').readline()[:-1]
137 | except:
138 | label = video_labels_dic[type]
139 |
140 | # build the folder of each type -- a01, a02, ..., a12 and save the label for each type
141 | if not os.path.exists(cur_image_path):
142 | os.makedirs(cur_image_path)
143 | save_pickle(label, cur_image_path + type + '_label.pkl')
144 |
145 | video_names = []
146 | # images_per_video = 17
147 |
148 | # read the name of videos
149 | video_txt = open(cur_video_path + 'videos.txt').readlines()
150 |
151 | # cut images from videos and resize them
152 | for index, name in enumerate(video_txt):
153 | print ('video' + name[:-1] + 'process ... ')
154 |
155 | # remove the data type
156 | name = name[:-5]
157 | rpath = cur_video_path + name + '.avi'
158 | spath = cur_image_path + name + '/'
159 |
160 | # build the folder for saved images
161 | if not os.path.exists(spath):
162 | os.makedirs(spath)
163 |
164 | # cut videos into images
165 | MAX = 100
166 | video2image(rpath, spath, MAX)
167 | video_names.append(name)
168 |
169 | # save the videos_names in images folder
170 | video_names = np.array(video_names)
171 | save_pickle(video_names, cur_image_path + '/' + type + '_video_names.pkl')
172 |
173 | # divide the data into train, val, and test
174 | seprate_data(folders, data_path + '/image/', data_path + '/data_set/')
175 |
176 | # label to idx dictionary
177 | label_to_idx = {'pick up with one hand': 1, 'pick up with two hands': 2, 'drop trash': 3, 'walk around': 4,
178 | 'sit down': 5, 'stand up': 6, 'donning': 7, 'doffing': 8, 'throw': 9, 'carry': 0}
179 | save_pickle(label_to_idx, data_path + '/data_set/label_to_idx.pkl')
180 |
181 |
182 | main()
183 |
--------------------------------------------------------------------------------
/train.py:
--------------------------------------------------------------------------------
1 | # update: 8.14.2017
2 | from core.solver import CaptioningSolver
3 | from core.model import CaptionGenerator
4 | from core.utils import *
5 |
6 | current_path = '/home/jingwei/Action Detection/A-R/data/'
7 |
8 |
9 | def main():
10 | train_data = load_data(current_path + 'data_set/', 'test')
11 | length = len(train_data['video_ids'])
12 | train_data['features'] = train_data['features'][:int(0.7 * length)]
13 | train_data['labels'] = train_data['labels'][:int(0.7 * length)]
14 | train_data['video_ids'] = train_data['video_ids'][:int(0.7 * length)]
15 | train_data['video_filenames'] = train_data['video_filenames'][:int(0.7 * length)]
16 |
17 | # train_data = {}
18 |
19 | data = {'train_data': train_data}
20 | label_to_idx = load_pickle(current_path + 'data_set/label_to_idx.pkl')
21 | num_images_per_video = 17
22 |
23 | model = CaptionGenerator(label_to_idx=label_to_idx, dim_feature=[196, 512],
24 | dim_hidden=1024, n_time_step=num_images_per_video, ctx2out=True,
25 | alpha_c=1.0, selector=True, dropout=False)
26 |
27 | solver = CaptioningSolver(model, data, n_epochs=500, batch_size=15, update_rule='adam',
28 | learning_rate=0.0006, print_every=3, save_every=10,
29 | pretrained_model=None, model_path=current_path + 'model/lstm/',
30 | test_model=current_path + 'model/lstm/model-430', log_path=current_path + 'log/',
31 | data_path=current_path + '/data_set/',
32 | test_result_save_path=current_path + 'data_set/test/model_test_result/',
33 | models_val_disp=current_path + 'model/models_accuracy_val.txt')
34 |
35 | solver.train()
36 | solver.all_model_val()
37 | # solver.test()
38 |
39 |
40 | if __name__ == "__main__":
41 | main()
42 |
--------------------------------------------------------------------------------