Commit d70f7091 authored by Taddeus Kroes's avatar Taddeus Kroes

Renamed all test data files to *.dat.

parent a3f5f5a4
chars *.dat
learning_set results.txt
test_set
classifier
classifier-model
classifier-characters
characters
best_classifier
...@@ -9,10 +9,10 @@ Y = [float(2 ** p) for p in xrange(-13, 4, 2)] ...@@ -9,10 +9,10 @@ Y = [float(2 ** p) for p in xrange(-13, 4, 2)]
best_classifier = None best_classifier = None
print 'Loading learning set...' 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 'Learning set:', [c.value for c in learning_set]
print 'Loading test 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] print 'Test set:', [c.value for c in test_set]
# Perform a grid-search on different combinations of soft margin and gamma # Perform a grid-search on different combinations of soft margin and gamma
...@@ -54,4 +54,4 @@ for c in C: ...@@ -54,4 +54,4 @@ for c in C:
print '\nmax:', maximum 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 ...@@ -3,7 +3,7 @@ from pylab import subplot, show, imshow, axis
from cPickle import load from cPickle import load
x, y = 25, 25 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 i in range(x):
for j in range(y): for j in range(y):
......
...@@ -3,7 +3,7 @@ from xml_helper_functions import xml_to_LicensePlate ...@@ -3,7 +3,7 @@ from xml_helper_functions import xml_to_LicensePlate
from Classifier import Classifier from Classifier import Classifier
from cPickle import dump, load from cPickle import dump, load
chars = load(file('characters2', 'r')) chars = load(file('characters.dat', 'r'))
learning_set = [] learning_set = []
test_set = [] test_set = []
...@@ -31,12 +31,12 @@ for char in chars: ...@@ -31,12 +31,12 @@ for char in chars:
print 'Learning set:', [c.value for c in learning_set] print 'Learning set:', [c.value for c in learning_set]
print 'Test set:', [c.value for c in test_set] print 'Test set:', [c.value for c in test_set]
print 'Saving learning set...' print 'Saving learning set...'
dump(learning_set, file('learning_set', 'w+')) dump(learning_set, file('learning_set.dat', 'w+'))
print 'Saving test set...' print 'Saving test set...'
dump(test_set, file('test_set', 'w+')) dump(test_set, file('test_set.dat', 'w+'))
#---------------------------------------------------------------- #----------------------------------------------------------------
print 'Loading learning set' 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 # Train the classifier with the learning set
classifier = Classifier(c=512, gamma=.125, cell_size=12) classifier = Classifier(c=512, gamma=.125, cell_size=12)
...@@ -47,7 +47,7 @@ classifier.train(learning_set) ...@@ -47,7 +47,7 @@ classifier.train(learning_set)
#print 'Loading classifier' #print 'Loading classifier'
#classifier = Classifier(filename='classifier') #classifier = Classifier(filename='classifier')
print 'Loading test set' print 'Loading test set'
test_set = load(file('test_set', 'r')) test_set = load(file('test_set.dat', 'r'))
l = len(test_set) l = len(test_set)
matches = 0 matches = 0
......
...@@ -5,7 +5,7 @@ from GrayscaleImage import GrayscaleImage ...@@ -5,7 +5,7 @@ from GrayscaleImage import GrayscaleImage
from cPickle import load from cPickle import load
from numpy import zeros, resize from numpy import zeros, resize
chars = load(file('characters', 'r'))[::2] chars = load(file('characters.dat', 'r'))[::2]
left = None left = None
right = 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