1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

FP16 Caffe models import and export

This commit is contained in:
Dmitry Kurtaev
2017-09-08 13:31:29 +03:00
parent 6bf8fe815d
commit 8646d5fb84
7 changed files with 937 additions and 463 deletions
+13
View File
@@ -701,6 +701,19 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
CV_EXPORTS_W Mat blobFromImages(const std::vector<Mat>& images, double scalefactor=1.0,
Size size = Size(), const Scalar& mean = Scalar(), bool swapRB=true);
/** @brief Convert all weights of Caffe network to half precision floating point.
* @param src Path to origin model from Caffe framework contains single
* precision floating point weights (usually has `.caffemodel` extension).
* @param dst Path to destination model with updated weights.
*
* @note Shrinked model has no origin float32 weights so it can't be used
* in origin Caffe framework anymore. However the structure of data
* is taken from NVidia's Caffe fork: https://github.com/NVIDIA/caffe.
* So the resulting model may be used there.
*/
CV_EXPORTS_W void shrinkCaffeModel(const String& src, const String& dst);
//! @}
CV__DNN_EXPERIMENTAL_NS_END
}