Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
licenseplates
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
licenseplates
Commits
d70f7091
Commit
d70f7091
authored
Dec 20, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed all test data files to *.dat.
parent
a3f5f5a4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
18 deletions
+12
-18
src/.gitignore
src/.gitignore
+2
-8
src/find_svm_params.py
src/find_svm_params.py
+3
-3
src/test_chars.py
src/test_chars.py
+1
-1
src/test_classifier.py
src/test_classifier.py
+5
-5
src/test_compare.py
src/test_compare.py
+1
-1
No files found.
src/.gitignore
View file @
d70f7091
chars
learning_set
test_set
classifier
classifier-model
classifier-characters
characters
best_classifier
*.dat
results.txt
src/find_svm_params.py
View file @
d70f7091
...
...
@@ -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
')
src/test_chars.py
View file @
d70f7091
...
...
@@ -3,7 +3,7 @@ from pylab import subplot, show, imshow, axis
from
cPickle
import
load
x
,
y
=
25
,
25
chars
=
load
(
file
(
'char
s
'
,
'r'
))[:(
x
*
y
)]
chars
=
load
(
file
(
'char
acters.dat
'
,
'r'
))[:(
x
*
y
)]
for
i
in
range
(
x
):
for
j
in
range
(
y
):
...
...
src/test_classifier.py
View file @
d70f7091
...
...
@@ -3,7 +3,7 @@ from xml_helper_functions import xml_to_LicensePlate
from
Classifier
import
Classifier
from
cPickle
import
dump
,
load
chars
=
load
(
file
(
'characters
2
'
,
'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
...
...
src/test_compare.py
View file @
d70f7091
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment