Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ae851af6
Commit
ae851af6
authored
Oct 08, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Oct 08, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1574 from alalek:svm_workaround
parents
65ec9f77
f63b0dfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
svm.cpp
modules/ml/src/svm.cpp
+2
-0
test_ml.cpp
modules/ocl/test/test_ml.cpp
+4
-2
No files found.
modules/ml/src/svm.cpp
View file @
ae851af6
...
@@ -1343,6 +1343,8 @@ bool CvSVM::do_train( int svm_type, int sample_count, int var_count, const float
...
@@ -1343,6 +1343,8 @@ bool CvSVM::do_train( int svm_type, int sample_count, int var_count, const float
for
(
i
=
0
;
i
<
sample_count
;
i
++
)
for
(
i
=
0
;
i
<
sample_count
;
i
++
)
sv_count
+=
fabs
(
alpha
[
i
])
>
0
;
sv_count
+=
fabs
(
alpha
[
i
])
>
0
;
CV_Assert
(
sv_count
!=
0
);
sv_total
=
df
->
sv_count
=
sv_count
;
sv_total
=
df
->
sv_count
=
sv_count
;
CV_CALL
(
df
->
alpha
=
(
double
*
)
cvMemStorageAlloc
(
storage
,
sv_count
*
sizeof
(
df
->
alpha
[
0
]))
);
CV_CALL
(
df
->
alpha
=
(
double
*
)
cvMemStorageAlloc
(
storage
,
sv_count
*
sizeof
(
df
->
alpha
[
0
]))
);
CV_CALL
(
sv
=
(
float
**
)
cvMemStorageAlloc
(
storage
,
sv_count
*
sizeof
(
sv
[
0
])));
CV_CALL
(
sv
=
(
float
**
)
cvMemStorageAlloc
(
storage
,
sv_count
*
sizeof
(
sv
[
0
])));
...
...
modules/ocl/test/test_ml.cpp
View file @
ae851af6
...
@@ -289,9 +289,11 @@ TEST_P(SVM_OCL, Accuracy)
...
@@ -289,9 +289,11 @@ TEST_P(SVM_OCL, Accuracy)
}
}
}
}
}
}
// TODO FIXIT: CvSVM::EPS_SVR case is crashed inside CPU implementation
// Anonymous enums are not supported well so cast them to 'int'
INSTANTIATE_TEST_CASE_P
(
OCL_ML
,
SVM_OCL
,
testing
::
Combine
(
INSTANTIATE_TEST_CASE_P
(
OCL_ML
,
SVM_OCL
,
testing
::
Combine
(
Values
(
CvSVM
::
LINEAR
,
CvSVM
::
POLY
,
CvSVM
::
RBF
,
CvSVM
::
SIGMOID
),
Values
(
(
int
)
CvSVM
::
LINEAR
,
(
int
)
CvSVM
::
POLY
,
(
int
)
CvSVM
::
RBF
,
(
int
)
CvSVM
::
SIGMOID
),
Values
(
CvSVM
::
C_SVC
,
CvSVM
::
NU_SVC
,
CvSVM
::
ONE_CLASS
,
CvSVM
::
EPS_SVR
,
CvSVM
::
NU_SVR
),
Values
(
(
int
)
CvSVM
::
C_SVC
,
(
int
)
CvSVM
::
NU_SVC
,
(
int
)
CvSVM
::
ONE_CLASS
,
(
int
)
CvSVM
::
NU_SVR
),
Values
(
2
,
3
,
4
)
Values
(
2
,
3
,
4
)
));
));
#endif // HAVE_OPENCL
#endif // HAVE_OPENCL
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