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
1848170e
Commit
1848170e
authored
Dec 21, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup.
parent
85c8eaae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
src/Classifier.py
src/Classifier.py
+1
-2
src/create_classifier.py
src/create_classifier.py
+2
-2
No files found.
src/Classifier.py
View file @
1848170e
...
@@ -5,8 +5,6 @@ from svmutil import svm_train, svm_problem, svm_parameter, svm_predict, \
...
@@ -5,8 +5,6 @@ from svmutil import svm_train, svm_problem, svm_parameter, svm_predict, \
class
Classifier
:
class
Classifier
:
def
__init__
(
self
,
c
=
None
,
gamma
=
None
,
filename
=
None
,
neighbours
=
3
,
\
def
__init__
(
self
,
c
=
None
,
gamma
=
None
,
filename
=
None
,
neighbours
=
3
,
\
verbose
=
0
):
verbose
=
0
):
self
.
neighbours
=
neighbours
if
filename
:
if
filename
:
# If a filename is given, load a model from the given filename
# If a filename is given, load a model from the given filename
self
.
model
=
svm_load_model
(
filename
)
self
.
model
=
svm_load_model
(
filename
)
...
@@ -19,6 +17,7 @@ class Classifier:
...
@@ -19,6 +17,7 @@ class Classifier:
self
.
param
.
gamma
=
gamma
# Parameter for radial kernel
self
.
param
.
gamma
=
gamma
# Parameter for radial kernel
self
.
model
=
None
self
.
model
=
None
self
.
neighbours
=
neighbours
self
.
verbose
=
verbose
self
.
verbose
=
verbose
def
save
(
self
,
filename
):
def
save
(
self
,
filename
):
...
...
src/create_classifier.py
View file @
1848170e
...
@@ -12,8 +12,8 @@ def load_classifier(neighbours, blur_scale, c=None, gamma=None, verbose=0):
...
@@ -12,8 +12,8 @@ def load_classifier(neighbours, blur_scale, c=None, gamma=None, verbose=0):
if
verbose
:
if
verbose
:
print
'Loading classifier...'
print
'Loading classifier...'
classifier
=
Classifier
(
filename
=
classifier_file
,
verbose
=
verbose
)
classifier
=
Classifier
(
filename
=
classifier_file
,
\
classifier
.
neighbours
=
neighbours
neighbours
=
neighbours
,
verbose
=
verbose
)
elif
c
!=
None
and
gamma
!=
None
:
elif
c
!=
None
and
gamma
!=
None
:
if
verbose
:
if
verbose
:
print
'Training new classifier...'
print
'Training new classifier...'
...
...
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