plugin  0.1.0
image_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 writing, 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 <stddef.h>
19 
20 #include <memory>
21 #include <string>
22 
23 #include "models/model_base.h"
24 #include "utils/image_utils.h"
25 
26 namespace ov {
27 class InferRequest;
28 } // namespace ov
29 struct InputData;
30 struct InternalModelData;
31 
32 class ImageModel : public ModelBase {
33 public:
38  ImageModel(const std::string& modelFileName, bool useAutoResize, const std::string& layout = "");
39 
40  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
41 
42 protected:
43  bool useAutoResize;
44 
45  size_t netInputHeight = 0;
46  size_t netInputWidth = 0;
47  cv::InterpolationFlags interpolationMode = cv::INTER_LINEAR;
48  RESIZE_MODE resizeMode = RESIZE_FILL;
49 };
Definition: image_model.h:32
ImageModel(const std::string &modelFileName, bool useAutoResize, const std::string &layout="")
Definition: image_model.cpp:31
Definition: model_base.h:34
Definition: input_data.h:20
Definition: internal_model_data.h:19