1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Merge pull request #28678 from omrope79:caffe-importer-cleanup

Caffe importer cleanup #28678

Merge with: https://github.com/opencv/opencv_extra/pull/1324

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
omrope79
2026-06-02 19:58:10 +05:30
committed by GitHub
parent 42fc6939f8
commit b67ad9a422
34 changed files with 327 additions and 5674 deletions
@@ -18,9 +18,10 @@ namespace barcode {
constexpr static float MAX_SCALE = 4.0f;
int SuperScale::init(const std::string &proto_path, const std::string &model_path)
int SuperScale::init(const std::string &model_path)
{
srnet_ = dnn::readNetFromCaffe(proto_path, model_path);
// Super Resolution is loaded from a single-file ONNX model (e.g. dnn/wechat_2021-01/sr.onnx).
srnet_ = dnn::readNetFromONNX(model_path);
net_loaded_ = true;
return 0;
}
@@ -77,9 +78,8 @@ int SuperScale::superResolutionScale(const Mat &src, Mat &dst)
#else // HAVE_OPENCV_DNN
int SuperScale::init(const std::string &proto_path, const std::string &model_path)
int SuperScale::init(const std::string &model_path)
{
CV_UNUSED(proto_path);
CV_UNUSED(model_path);
return 0;
}
@@ -22,7 +22,7 @@ public:
~SuperScale() = default;
int init(const std::string &proto_path, const std::string &model_path);
int init(const std::string &model_path);
void processImageScale(const Mat &src, Mat &dst, float scale, const bool &use_sr, int sr_max_size = 160);