batchsize = 16
loadsize = 128
input_feature_layer_name = 'reshape1'
metric_feature_layer_name = 'relu2'

minlen = 5
maxlen = 5

weight_decay = np.float32(.2)
gradient_clip_threshold = 1.

train_data_provider = KTHDataProvider(
    batchsize=loadsize,
    minlen=minlen,
    maxlen=maxlen,
    numpy_rng=numpy_rng,
    frames_dir='../data_preparation/kth/frames',
    pkl_file='kth.pkl',
    bbox_file='../data_preparation/kth/KTHBoundingBoxInfo.txt',
    persons=train_persons,
    actions=('jogging', 'running', 'walking'))
print 'fetching 100 samples from training set for approx of train IoUs...'
train_data = train_data_provider.get_batch(return_all=True)

perm = numpy_rng.permutation(train_data['inputs'].shape[0])[:100]

train_data['inputs'] = train_data['inputs'][perm]
train_data['targets'] = train_data['targets'][perm]
train_data['masks'] = train_data['masks'][perm]

print 'fetching validation set...'
val_data_provider = KTHDataProvider(
Beispiel #2
0
batchsize = 16
loadsize = 128
input_feature_layer_name = 'reshape1'
metric_feature_layer_name = 'relu2'

plt.gray()

weight_decay = np.float32(.2)

numpy_rng = np.random.RandomState(1)

print 'fetching test set...'
test_data_provider = KTHDataProvider(
    numpy_rng=numpy_rng,
    frames_dir='/data/lisatmp3/michals/data/KTH/frames',
    pkl_file='kth.pkl',
    bbox_file='/data/lisatmp3/michals/data/KTH/KTHBoundingBoxInfo.txt',
    persons=[args.test_person],
    actions=('jogging', 'running', 'walking'))
test_data = test_data_provider.get_batch()

print 'loading pretrained CNN...'
feature_network = HumanConvNet(name='Person CNN',
                               nout=2,
                               numpy_rng=numpy_rng,
                               theano_rng=theano_rng,
                               batchsize=batchsize)
feature_network.load('convnet_eth_inria_data/human_convnet_val_best.h5')
feature_network.mode.set_value(np.uint8(1))

print "instantiating model..."
Beispiel #3
0
nhid = 32
batchsize = 16
loadsize = 128
input_feature_layer_name = 'reshape1'
metric_feature_layer_name = 'relu2'

plt.gray()

weight_decay = np.float32(.2)

numpy_rng = np.random.RandomState(1)

print 'fetching test set...'
test_data_provider = KTHDataProvider(
    numpy_rng=numpy_rng,
    frames_dir='/data/lisatmp3/michals/data/KTH/frames',
    pkl_file='kth.pkl',
    bbox_file='/data/lisatmp3/michals/data/KTH/KTHBoundingBoxInfo.txt',
    persons=[args.test_person], actions=('jogging', 'running', 'walking'))
test_data = test_data_provider.get_batch()

print 'loading pretrained CNN...'
feature_network = HumanConvNet(
    name='Person CNN', nout=2, numpy_rng=numpy_rng,
    theano_rng=theano_rng, batchsize=batchsize)
feature_network.load('convnet_eth_inria_data/human_convnet_val_best.h5')
feature_network.mode.set_value(np.uint8(1))

print "instantiating model..."
model = RATM(name='RATM', imsize=imsize,
             patchsize=patchsize, nhid=nhid,
             numpy_rng=numpy_rng, eps=1e-4,
imsize = (120, 160)
nhid = 32
batchsize = 16
loadsize = 128
input_feature_layer_name = 'reshape1'
metric_feature_layer_name = 'relu2'

minlen = 5
maxlen = 5

weight_decay = np.float32(.2)
gradient_clip_threshold = 1.

train_data_provider = KTHDataProvider(
    batchsize=loadsize, minlen=minlen, maxlen=maxlen, numpy_rng=numpy_rng,
    frames_dir='../data_preparation/kth/frames',
    pkl_file='kth.pkl',
    bbox_file='../data_preparation/kth/KTHBoundingBoxInfo.txt',
    persons=train_persons, actions=('jogging', 'running', 'walking'))
print 'fetching 100 samples from training set for approx of train IoUs...'
train_data = train_data_provider.get_batch(return_all=True)

perm = numpy_rng.permutation(train_data['inputs'].shape[0])[:100]

train_data['inputs'] = train_data['inputs'][perm]
train_data['targets'] = train_data['targets'][perm]
train_data['masks'] = train_data['masks'][perm]

print 'fetching validation set...'
val_data_provider = KTHDataProvider(
    numpy_rng=numpy_rng,
    frames_dir='../data_preparation/kth/frames',