-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path0.1_visualizeDataset.py
44 lines (29 loc) · 966 Bytes
/
0.1_visualizeDataset.py
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
35
36
37
38
39
import matplotlib.pyplot as plt
from util import displayImagesAndLabels, readDatabase, displayLabelImages
import seaborn as sns
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--verbose", required=False, help="show images")
args = vars(ap.parse_args())
verbose = args["verbose"]
if verbose is None:
verbose = False
else:
verbose = bool(verbose)
sns.set(style='white', context='notebook', palette='deep')
xTrain, yTrain, xTest, yTest, yLabels = readDatabase(reshape=True, categoricalValues=False)
barValues = yTrain.value_counts()
print("\nNumber of training dataset: ")
print(xTrain.shape)
print("\nNumber of of images per label: ")
print(barValues)
print("\nNumber of test dataset: ")
print(xTest.shape)
if verbose:
g = sns.countplot(yTrain)
plt.show()
g = sns.countplot(yTest)
plt.show()
displayImagesAndLabels(xTrain, yTrain)
for i in range(0,10):
displayLabelImages(xTrain, yTrain, i)