plugin  0.1.0
super_resolution_model.h
1 /*
2 // Copyright (C) 2021-2024 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writingb software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
17 #pragma once
18 #include <memory>
19 #include <string>
20 
21 #include <opencv2/core/types.hpp>
22 
23 #include "models/image_model.h"
24 
25 namespace ov {
26 class InferRequest;
27 class Model;
28 } // namespace ov
29 struct InferenceResult;
30 struct InputData;
31 struct InternalModelData;
32 struct ResultBase;
33 
35 public:
39  SuperResolutionModel(const std::string& modelFileName,
40  const cv::Size& inputImgSize,
41  const std::string& layout = "");
42 
43  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
44  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
45 
46 protected:
47  void changeInputSize(std::shared_ptr<ov::Model>& model, int coeff);
48  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
49 };
50 
52 public:
54 
55  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
56  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
57  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
58  void setBatch(std::shared_ptr<ov::Model>& model) override;
59 };
Definition: image_model.h:32
Definition: super_resolution_model.h:51
Definition: super_resolution_model.h:34
SuperResolutionModel(const std::string &modelFileName, const cv::Size &inputImgSize, const std::string &layout="")
Definition: super_resolution_model.cpp:38
Definition: results.h:53
Definition: input_data.h:20
Definition: internal_model_data.h:19
Definition: results.h:29