from helperFunctions import getUCF101
from helperFunctions import loadFrame

import h5py
import cv2

from multiprocessing import Pool

IMAGE_SIZE = 224
NUM_CLASSES = 101
batch_size = 100
lr = 0.0001
num_of_epochs = 10

data_directory = '/projects/training/bauh/AR/'
class_list, train, test = getUCF101(base_directory=data_directory)

model = torchvision.models.resnet50(pretrained=True)
model.fc = nn.Linear(2048, NUM_CLASSES)

for param in model.parameters():
    param.requires_grad_(False)

for param in model.layer4[2].parameters():
    param.requires_grad_(True)
for param in model.fc.parameters():
    param.requires_grad_(True)

params = []

for param in model.layer4[2].parameters():
Beispiel #2
0
def main():
    data_directory = '/projects/training/bauh/AR/'
    class_list, train, test = getUCF101(base_directory=data_directory)
    print_confusion_matrix(class_list=class_list,
                           file_path='part3_confusion_matrix.npy')
Beispiel #3
0
import time
import math

import chainer
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L

from helperFunctions import getUCF101
from helperFunctions import getVideoFeatures
from helperFunctions import repeatSequence

import h5py

class_list, train, test = getUCF101()

print "LOAD DATA..."
for i in xrange(len(train[0])):
	train[0][i] = train[0][i].split('/')[2].split('.avi')[0]

train_hdf5 = h5py.File('train1024.hdf5','r')
print "Train..."
keys = train_hdf5.keys()
t1 = time.time()
for key in keys:
	data = train_hdf5[key][:]
t2 = time.time()
print t2-t1

for i in xrange(len(test[0])):
Beispiel #4
0
from helperFunctions import getUCF101
from helperFunctions import loadFrame

import h5py
import cv2

from multiprocessing import Pool

IMAGE_SIZE = 224
NUM_CLASSES = 101
batch_size = 100
lr = 0.0001
num_of_epochs = 10

data_directory = '/projects/training/bayw/hdf5/'
class_list, train, test = getUCF101(
    base_directory='/projects/training/bayw/hdf5/')

model = torchvision.models.resnet50(pretrained=True)
model.fc = nn.Linear(2048, NUM_CLASSES)

for param in model.parameters():
    param.requires_grad_(False)
for param in model.layer4[2].parameters():
    param.requires_grad_(True)
for param in model.fc.parameters():
    param.requires_grad_(True)

params = []
for param in model.layer4[2].parameters():
    params.append(param)
for param in model.fc.parameters():