Support loading old models in ML module
- added test for loading legacy files - added version to new written models - fixed loading of several fields in some models - added generation of new fields from old data
This commit is contained in:
@@ -263,11 +263,27 @@ namespace ml
|
||||
vector<int> subsets;
|
||||
vector<int> classLabels;
|
||||
vector<float> missingSubst;
|
||||
vector<int> varMapping;
|
||||
bool _isClassifier;
|
||||
|
||||
Ptr<WorkData> w;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
static inline void readVectorOrMat(const FileNode & node, std::vector<T> & v)
|
||||
{
|
||||
if (node.type() == FileNode::MAP)
|
||||
{
|
||||
Mat m;
|
||||
node >> m;
|
||||
m.copyTo(v);
|
||||
}
|
||||
else if (node.type() == FileNode::SEQ)
|
||||
{
|
||||
node >> v;
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif /* __OPENCV_ML_PRECOMP_HPP__ */
|
||||
|
||||
Reference in New Issue
Block a user