Merge pull request #5922 from DarwinsBuddy:fix_no_py_load_svm_bug
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user