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
06246989
Commit
06246989
authored
Dec 21, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pretiffied a print statement and tested run_classifier script.
parent
79884e9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/create_characters.py
src/create_characters.py
+5
-1
src/run_classifier.py
src/run_classifier.py
+8
-2
No files found.
src/create_characters.py
View file @
06246989
...
...
@@ -21,6 +21,8 @@ def load_characters(neighbours, blur_scale, verbose=0):
chars
=
[]
for
char
in
sorted
(
listdir
(
IMAGES_FOLDER
)):
count
=
0
for
image
in
sorted
(
listdir
(
IMAGES_FOLDER
+
char
)):
image
=
GrayscaleImage
(
IMAGES_FOLDER
+
char
+
'/'
+
image
)
norm
=
NormalizedCharacterImage
(
image
,
blur
=
blur_scale
,
\
...
...
@@ -29,8 +31,10 @@ def load_characters(neighbours, blur_scale, verbose=0):
character
.
get_single_cell_feature_vector
(
neighbours
)
chars
.
append
(
character
)
count
+=
1
if
verbose
:
print
'Loaded character %s
'
%
char
print
'Loaded character %s
%d times'
%
(
char
,
count
)
if
verbose
:
print
'Saving characters...'
...
...
src/run_classifier.py
View file @
06246989
...
...
@@ -7,14 +7,20 @@ from create_characters import load_test_set
from
create_classifier
import
load_classifier
if
len
(
argv
)
<
3
:
print
'Usage: python %s NEIGHBOURS BLUR_SCALE'
%
argv
[
0
]
print
'Usage: python %s NEIGHBOURS BLUR_SCALE
[ C GAMMA ]
'
%
argv
[
0
]
exit
(
1
)
neighbours
=
int
(
argv
[
1
])
blur_scale
=
float
(
argv
[
2
])
# Load classifier
classifier
=
load_classifier
(
neighbours
,
blur_scale
,
verbose
=
1
)
if
len
(
argv
)
>
4
:
c
=
float
(
argv
[
3
])
gamma
=
float
(
argv
[
4
])
classifier
=
load_classifier
(
neighbours
,
blur_scale
,
c
=
c
,
gamma
=
gamma
,
\
verbose
=
1
)
else
:
classifier
=
load_classifier
(
neighbours
,
blur_scale
,
verbose
=
1
)
# Load test set
test_set
=
load_test_set
(
neighbours
,
blur_scale
,
verbose
=
1
)
...
...
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