提交 b35f5d11 编写于 作者: T TobyWanKenobi

Removed "FORMAT_XML" to generalize format

Removed the "FileStorage::FORMAT_XML" to generalize format of the String
model.
上级 f54b80d2
......@@ -827,15 +827,15 @@ public:
return model->isTrained() ? model : Ptr<_Tp>();
}
/** @brief Loads model from an XML String
@param strModel The string variable containing the model (in an XML format) you want to load.
/** @brief Loads model from a String
@param strModel The string variable containing the model you want to load.
This is static template method of StatModel. It's usage is following (in the case of SVM):
Ptr<SVM> svm = StatModel::loadFromString<SVM>(myXMLStringModel);
Ptr<SVM> svm = StatModel::loadFromString<SVM>(myStringModel);
*/
template<typename _Tp> static Ptr<_Tp> loadFromString(const String& strModel)
{
FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY + FileStorage::FORMAT_XML);
FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);
Ptr<_Tp> model = _Tp::create();
model->read(fs.getFirstTopLevelNode());
return model->isTrained() ? model : Ptr<_Tp>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册