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
df89e76f
Commit
df89e76f
authored
Jan 14, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5922 from DarwinsBuddy:fix_no_py_load_svm_bug
parents
bc46682b
3f172731
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
ml.hpp
modules/ml/include/opencv2/ml.hpp
+19
-0
ann_mlp.cpp
modules/ml/src/ann_mlp.cpp
+13
-1
svm.cpp
modules/ml/src/svm.cpp
+11
-0
No files found.
modules/ml/include/opencv2/ml.hpp
View file @
df89e76f
...
...
@@ -719,6 +719,15 @@ public:
Use StatModel::train to train the model. Since %SVM has several parameters, you may want to
find the best parameters for your problem, it can be done with SVM::trainAuto. */
CV_WRAP
static
Ptr
<
SVM
>
create
();
/** @brief Loads and creates a serialized svm from a file
*
* Use SVM::save to serialize and store an SVM to disk.
* Load the SVM from this file again, by calling this function with the path to the file.
*
* @param filepath path to serialized svm
*/
CV_WRAP
static
Ptr
<
SVM
>
load
(
const
String
&
filepath
);
};
/****************************************************************************************\
...
...
@@ -1389,6 +1398,16 @@ public:
Note that the train method has optional flags: ANN_MLP::TrainFlags.
*/
CV_WRAP
static
Ptr
<
ANN_MLP
>
create
();
/** @brief Loads and creates a serialized ANN from a file
*
* Use ANN::save to serialize and store an ANN to disk.
* Load the ANN from this file again, by calling this function with the path to the file.
*
* @param filepath path to serialized ANN
*/
CV_WRAP
static
Ptr
<
ANN_MLP
>
load
(
const
String
&
filepath
);
};
/****************************************************************************************\
...
...
modules/ml/src/ann_mlp.cpp
View file @
df89e76f
...
...
@@ -1317,6 +1317,18 @@ Ptr<ANN_MLP> ANN_MLP::create()
return
makePtr
<
ANN_MLPImpl
>
();
}
}}
Ptr
<
ANN_MLP
>
ANN_MLP
::
load
(
const
String
&
filepath
)
{
FileStorage
fs
;
fs
.
open
(
filepath
,
FileStorage
::
READ
);
Ptr
<
ANN_MLP
>
ann
=
makePtr
<
ANN_MLPImpl
>
();
((
ANN_MLPImpl
*
)
ann
.
get
())
->
read
(
fs
.
getFirstTopLevelNode
());
return
ann
;
}
}}
/* End of file. */
modules/ml/src/svm.cpp
View file @
df89e76f
...
...
@@ -2261,6 +2261,17 @@ Ptr<SVM> SVM::create()
return
makePtr
<
SVMImpl
>
();
}
Ptr
<
SVM
>
SVM
::
load
(
const
String
&
filepath
)
{
FileStorage
fs
;
fs
.
open
(
filepath
,
FileStorage
::
READ
);
Ptr
<
SVM
>
svm
=
makePtr
<
SVMImpl
>
();
((
SVMImpl
*
)
svm
.
get
())
->
read
(
fs
.
getFirstTopLevelNode
());
return
svm
;
}
Mat
SVM
::
getUncompressedSupportVectors
()
const
{
const
SVMImpl
*
this_
=
dynamic_cast
<
const
SVMImpl
*>
(
this
);
...
...
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