aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-02-04 16:28:36 +0000
committerVasil Zlatanov <v@skozl.com>2019-02-04 16:28:36 +0000
commit82d295c4693e17b71c52632740f4f98e141f8d49 (patch)
tree45d537accff05cdb6a9b10374c773048609d0855
parent0cfd207fc8549a67637ce7380ce62a6d3ebbd409 (diff)
downloade4-vision-82d295c4693e17b71c52632740f4f98e141f8d49.tar.gz
e4-vision-82d295c4693e17b71c52632740f4f98e141f8d49.tar.bz2
e4-vision-82d295c4693e17b71c52632740f4f98e141f8d49.zip
Add base evaluate.py
-rw-r--r--evaluate.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/evaluate.py b/evaluate.py
new file mode 100644
index 0000000..6504ec1
--- /dev/null
+++ b/evaluate.py
@@ -0,0 +1,24 @@
+# EE4 Selected Topics From Computer Vision Coursework
+# Vasil Zlatanov, Nunzio Pucci
+
+CLUSTER_CNT = 1337
+KMEAN_PART = 33
+
+import numpy as np
+import matplotlib.pyplot as plt
+
+from sklearn.cluster import KMeans
+
+train = []
+test = []
+
+train_part = np.hstack(train[0:KMEAN_PART])
+
+kmeans = KMeans(n_clusters=CLUSTER_CNT, random_state=0).fit(train_part)
+
+codewords = []
+i = 0
+
+for image in train:
+ codewords.append(np.bincount(kmeans.predict(image)
+ print codewords[i].shape