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
7af8660e
Commit
7af8660e
authored
Dec 21, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added performance measure script.
parent
6de11197
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
src/test_performance.py
src/test_performance.py
+37
-0
No files found.
src/test_performance.py
0 → 100755
View file @
7af8660e
#!/usr/bin/python
from
cPickle
import
load
from
sys
import
argv
,
exit
from
time
import
time
from
Classifier
import
Classifier
if
len
(
argv
)
<
4
:
print
'Usage: python %s NEIGHBOURS BLUR_SCALE COUNT'
%
argv
[
0
]
exit
(
1
)
neighbours
=
int
(
argv
[
1
])
blur_scale
=
float
(
argv
[
2
])
count
=
int
(
argv
[
3
])
suffix
=
'_%s_%s'
%
(
blur_scale
,
neighbours
)
chars_file
=
'characters%s.dat'
%
suffix
classifier_file
=
'classifier%s.dat'
%
suffix
print
'Loading characters...'
chars
=
load
(
open
(
chars_file
,
'r'
))[:
count
]
count
=
len
(
chars
)
print
'Read %d characters'
%
count
print
'Loading classifier...'
classifier
=
Classifier
(
filename
=
classifier_file
)
start
=
time
()
for
char
in
chars
:
classifier
.
classify
(
char
)
elapsed
=
time
()
-
start
individual
=
elapsed
/
count
print
'Took %fs to classify %d caracters (%fms per character)'
\
%
(
elapsed
,
count
,
individual
*
1000
)
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