plugin  0.1.0
jpeg_restoration_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 
19 #include <memory>
20 #include <string>
21 
22 #include <opencv2/core/types.hpp>
23 
24 #include "models/image_model.h"
25 
26 namespace ov {
27 class InferRequest;
28 class Model;
29 } // namespace ov
30 struct InferenceResult;
31 struct InputData;
32 struct InternalModelData;
33 struct ResultBase;
35 public:
41  JPEGRestorationModel(const std::string& modelFileName,
42  const cv::Size& inputImgSize,
43  bool jpegCompression,
44  const std::string& layout = "");
45 
46  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
47  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
48 
49 protected:
50  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
51  void changeInputSize(std::shared_ptr<ov::Model>& model);
52 
53  static const size_t stride = 8;
54  bool jpegCompression = false;
55 };
Definition: image_model.h:32
Definition: jpeg_restoration_model.h:34
JPEGRestorationModel(const std::string &modelFileName, const cv::Size &inputImgSize, bool jpegCompression, const std::string &layout="")
Definition: jpeg_restoration_model.cpp:39
Definition: results.h:53
Definition: input_data.h:20
Definition: internal_model_data.h:19
Definition: results.h:29