Tactile_Gesture_Language / load_sample.py
Tachintech's picture
Upload load_sample.py
7c5db1f verified
Raw
History Blame Contribute Delete
643 Bytes
import numpy as np
type = ['stroking', 'tapping', 'pressing', 'scratching', 'pinch', 'poke', 'grip', 'squeeze', 'knead', 'beat']
labels = []
datas = []
datamans = ['0', '1', '2', '3']
for i in range(len(type)):
for dataman in datamans:
data_path = './dataset/man' + dataman + '/' + type[i] + '_man' + dataman + '.npy'
data_samples = np.load(data_path)
for j in data_samples:
j = j.astype(np.int32)
j = np.expand_dims(j, axis=0)
datas.append(j)
labels.append(i)
datas = np.array(datas, dtype=np.int32)
labels = np.array(labels, dtype=np.int32)