Commit d70f7091 authored by Taddeus Kroes's avatar Taddeus Kroes

Renamed all test data files to *.dat.

parent a3f5f5a4
chars
learning_set
test_set
classifier
classifier-model
classifier-characters
characters
best_classifier
*.dat
results.txt
......@@ -9,10 +9,10 @@ Y = [float(2 ** p) for p in xrange(-13, 4, 2)]
best_classifier = None
print 'Loading learning set...'
learning_set = load(file('learning_set', 'r'))
learning_set = load(file('learning_set.dat', 'r'))
print 'Learning set:', [c.value for c in learning_set]
print 'Loading test set...'
test_set = load(file('test_set', 'r'))
test_set = load(file('test_set.dat', 'r'))
print 'Test set:', [c.value for c in test_set]
# Perform a grid-search on different combinations of soft margin and gamma
......@@ -54,4 +54,4 @@ for c in C:
print '\nmax:', maximum
best_classifier.save('best_classifier')
best_classifier.save('best_classifier.dat')
......@@ -3,7 +3,7 @@ from pylab import subplot, show, imshow, axis
from cPickle import load
x, y = 25, 25
chars = load(file('chars', 'r'))[:(x * y)]
chars = load(file('characters.dat', 'r'))[:(x * y)]
for i in range(x):
for j in range(y):
......
......@@ -3,7 +3,7 @@ from xml_helper_functions import xml_to_LicensePlate
from Classifier import Classifier
from cPickle import dump, load
chars = load(file('characters2', 'r'))
chars = load(file('characters.dat', 'r'))
learning_set = []
test_set = []
......@@ -31,12 +31,12 @@ for char in chars:
print 'Learning set:', [c.value for c in learning_set]
print 'Test set:', [c.value for c in test_set]
print 'Saving learning set...'
dump(learning_set, file('learning_set', 'w+'))
dump(learning_set, file('learning_set.dat', 'w+'))
print 'Saving test set...'
dump(test_set, file('test_set', 'w+'))
dump(test_set, file('test_set.dat', 'w+'))
#----------------------------------------------------------------
print 'Loading learning set'
learning_set = load(file('learning_set', 'r'))
learning_set = load(file('learning_set.dat', 'r'))
# Train the classifier with the learning set
classifier = Classifier(c=512, gamma=.125, cell_size=12)
......@@ -47,7 +47,7 @@ classifier.train(learning_set)
#print 'Loading classifier'
#classifier = Classifier(filename='classifier')
print 'Loading test set'
test_set = load(file('test_set', 'r'))
test_set = load(file('test_set.dat', 'r'))
l = len(test_set)
matches = 0
......
......@@ -5,7 +5,7 @@ from GrayscaleImage import GrayscaleImage
from cPickle import load
from numpy import zeros, resize
chars = load(file('characters', 'r'))[::2]
chars = load(file('characters.dat', 'r'))[::2]
left = None
right = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment