-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Add method in StatModel class, to load from a String #3473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added a method "loadFromString" which is based on the "load" one. It allow to directly pass the XML string which can be usefull and faster when you have a huge file in a variable.
Edited previous code to change tabs into spaces.
Attempting to re-editing the documentation, to satisfy buildbot error status.
Re-edited the documentation again.
|
@TobyWanKenobi, thank you! This may be useful indeed. One request though; please, remove FileStorage::FORMAT_XML, because our file storage reader can detect format automatically; sometimes people prefer YAML, and we are also thinking of adding JSON support. In other words, XML-only restriction is unnecessary and it does not simplify anything. |
Removed the "FileStorage::FORMAT_XML" to generalize format of the String model.
|
👍 |
|
@vpisarev Is this JSON support still in mind? I may need it to import some structure from motion file formats in opencv/opencv_contrib#509 |
|
@edgarriba , @vpisarev , Well, I would be interested to see JSON too as I/O backend. I always like alternatives and variety within the API offer. --------<<<------ But,
To example on the large scale: see https://github.com/cbalint13/opencv-dlco for how simple is to read / write / even with smart sub-windowed mode over large >8Gb HDF matrices & tensors, even with internal compressions. Such project woudn't be possible efficiently without OpenCV hdf5 module, would require spending more than half of devel time to invent some raw binaries or something to suite up with that large I/O. Ditto for outside world various neuralnets implemetation that uses tensors & matrices in tandem with HDF5 right from beginning of their development.
|
|
I agree with your opinion but as you mentioned and AFAIK, some sfm frameworks like OpenMVG and OpenSfM have their long term support in JSON format. |
Added a method "loadFromString", which is based on the "load" one, to the StatModel class. It
allow to directly pass a String of a saved model which can be usefull and faster when you have a huge trained file in a variable.