def video_processing(videos_dir): depth, height, width = 16, 120, 160 color = True factor = 4 vreader = VideoReader(depth, height, width, color, factor) X_train, Y_train, X_test, Y_test = vreader.loaddata(videos_dir) X_train = X_train.reshape( (X_train.shape[0], depth, height, width, 3)).astype('uint8') X_test = X_test.reshape( (X_test.shape[0], depth, height, width, 3)).astype('uint8') print('X_train shape:{}\nY_train shape:{}'.format(X_train.shape, Y_train.shape)) print('X_test shape:{}\nY_test shape:{}'.format(X_test.shape, Y_test.shape)) return X_train, Y_train.astype('uint32'), X_test, Y_test.astype('uint32')
def video_processing(videos_dir): depth, height, width = 16, 120, 160 color = True factor = 4 vreader = VideoReader(depth, height, width, color, factor) vreader.read_ucf_labels('../PA_HMDB51/privacy_split/classInd.txt') vreader.read_train_test_split('../PA_HMDB51/privacy_split/trainlist01.txt', '../PA_HMDB51/privacy_split/testlist01.txt') X_train, Y_train, X_test, Y_test = vreader.loaddata(videos_dir) X_train = X_train.reshape((X_train.shape[0], depth, height, width, 3)).astype('uint8') X_test = X_test.reshape((X_test.shape[0], depth, height, width, 3)).astype('uint8') print('X_train shape:{}\nY_train shape:{}'. format(X_train.shape, Y_train.shape)) print('X_test shape:{}\nY_test shape:{}'. format(X_test.shape, Y_test.shape)) return X_train, Y_train.astype('uint32'), X_test, Y_test.astype('uint32')