forked from mark-g-y/SignLanguageLadderNetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.py
More file actions
34 lines (30 loc) · 713 Bytes
/
Copy pathutility.py
File metadata and controls
34 lines (30 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import numpy as np
def parse_csv(filename):
f = open(filename)
linesr = f.readlines()
f.close()
total = 0
first = True
lines = []
labels = []
for line in linesr:
if first:
first = False
continue
line = line.strip().split(',')
line = map(lambda x: int(x), line)
labels.append(line[0])
lines.append(line[1:])
total += 1
return labels
y_train = parse_csv('sign_mnist_train.csv')
count = {}
for y in y_train:
if count.get(y) is None:
count[y] = 0
count[y] = count[y] + 1
values = np.array(count.values())
print np.mean(values)
print np.std(values)
print np.max(values)
print np.min(values)