Added CMU 35 motion capture data.

This commit is contained in:
Neil Lawrence 2013-04-27 00:52:10 +01:00
parent 8b00c5a827
commit d7ac1d025b

View file

@ -217,7 +217,6 @@ def crescent_data(num_data=200, seed=default_seed):
Y = np.vstack((np.ones((num_data_part[0] + num_data_part[1], 1)), -np.ones((num_data_part[2] + num_data_part[3], 1))))
return {'X':X, 'Y':Y, 'info': "Two separate classes of data formed approximately in the shape of two crescents."}
def creep_data():
all_data = np.loadtxt(os.path.join(data_path, 'creep', 'taka'))
y = all_data[:, 1:2].copy()
@ -226,3 +225,49 @@ def creep_data():
X = all_data[:, features].copy()
return {'X': X, 'y' : y}
def cmu_35_walk_jog():
skel = GPy.util.mocap.acclaim_skeleton(os.path.join(data_path, 'mocap', 'cmu', '35', '35.asf'))
examples = ['01', '02', '03', '04', '05', '06',
'07', '08', '09', '10', '11', '12',
'13', '14', '15', '16', '17', '19',
'20', '21', '22', '23', '24', '25',
'26', '28', '30', '31', '32', '33', '34']
test_examples = ['18', '29']
# Label differently for each sequence
exlbls = np.eye(31)
testexlbls = np.eye(2)
tot_length = 0
tot_test_length = 0
tY = []
tlbls = []
for i in range(len(examples)):
tmpchan = skel.load_channels(os.path.join(data_path, 'mocap', 'cmu', '35', '35_' + examples[i] + '.amc'))
tY.append(tmpchan[::4, :])
tlbls.append(np.tile(exlbls[i, :], (tY[i].shape[0], 1)))
tot_length += tY[i].shape[0]
Y = np.zeros((tot_length, tY[0].shape[1]))
lbls = np.zeros((tot_length, tlbls[0].shape[1]))
endInd = 0
for i in range(len(tY)):
startInd = endInd
endInd += tY[i].shape[0]
Y[startInd:endInd, :] = tY[i]
lbls[startInd:endInd, :] = tlbls[i]
tYtest = []
tlblstest = []
for i in range(len(test_examples)):
tmpchan = skel.load_channels(os.path.join(data_path, 'mocap', 'cmu', '35', '35_' + test_examples[i] + '.amc'))
tYtest.append(tmpchan[::4, :])
tlblstest.append(np.tile(testexlbls[i, :], (tYtest[i].shape[0], 1)))
tot_test_length += tYtest[i].shape[0]
Ytest = np.zeros((tot_test_length, tYtest[0].shape[1]))
lblstest = np.zeros((tot_test_length, tlblstest[0].shape[1]))
endInd = 0
for i in range(len(tYtest)):
startInd = endInd
endInd += tYtest[i].shape[0]
Ytest[startInd:endInd, :] = tYtest[i]
lblstest[startInd:endInd, :] = tlblstest[i]
return {'Y': Y, 'lbls' : lbls, 'Ytest': Ytest, 'lblstest' : lblstest, 'info': "Walk and jog data from CMU data base subject 35."}