Thus, with the goal of having one (small) file to represent the result of training all the steps in my algorithm (where some steps require serializing data structures from other libraries), the current approach I take is to save the SVM to its own temporary file, read the file from disk, compress the data, and finally write it to a file stream alongside the other portions of the algorithm. However, other parts, like OpenCV's SVM classifier are difficult to serialize as the only mechanisms for doing so are 1) directly to a file or 2) using the FileStorage class. Parts of the algorithm, like PCA using the Eigen matrix format are easy to serialize as a binary format. The problem i've run into while writing a gender classification algorithm is one of data persistence for the entire algorithm. mat A Mat object representing the image to be written. imwrite (filename, mat) This method accepts the following parameters filename A String variable representing the path where to save the file. Furthermore, if implemented, a great extension to this would be to provide a mechanism for representing FileStorage as a buffer in memory. To write an image, you need to invoke the imwrite () method of the Imgcodecs class. It would be wonderful if FileStorage also supported serialization to a binary format when file size is more important than file readability.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |