plugin  0.1.0
segmentation_model.h
1 /*
2 // Copyright (C) 2020-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 #include <vector>
21 
22 #include "models/image_model.h"
23 
24 namespace ov {
25 class Model;
26 } // namespace ov
27 struct InferenceResult;
28 struct ResultBase;
29 
30 #pragma once
31 class SegmentationModel : public ImageModel {
32 public:
38  SegmentationModel(const std::string& modelFileName, bool useAutoResize, const std::string& layout = "");
39 
40  static std::vector<std::string> loadLabels(const std::string& labelFilename);
41 
42  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
43 
44 protected:
45  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
46 
47  int outHeight = 0;
48  int outWidth = 0;
49  int outChannels = 0;
50 };
Definition: image_model.h:32
Definition: segmentation_model.h:31
SegmentationModel(const std::string &modelFileName, bool useAutoResize, const std::string &layout="")
Definition: segmentation_model.cpp:34
Definition: results.h:53
Definition: results.h:29