Tachintech commited on
Commit
7c5db1f
·
verified ·
1 Parent(s): 5f3088b

Upload load_sample.py

Browse files
Files changed (1) hide show
  1. load_sample.py +20 -0
load_sample.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+
3
+ type = ['stroking', 'tapping', 'pressing', 'scratching', 'pinch', 'poke', 'grip', 'squeeze', 'knead', 'beat']
4
+ labels = []
5
+ datas = []
6
+ datamans = ['0', '1', '2', '3']
7
+
8
+
9
+ for i in range(len(type)):
10
+ for dataman in datamans:
11
+ data_path = './dataset/man' + dataman + '/' + type[i] + '_man' + dataman + '.npy'
12
+ data_samples = np.load(data_path)
13
+ for j in data_samples:
14
+ j = j.astype(np.int32)
15
+ j = np.expand_dims(j, axis=0)
16
+ datas.append(j)
17
+ labels.append(i)
18
+
19
+ datas = np.array(datas, dtype=np.int32)
20
+ labels = np.array(labels, dtype=np.int32)