plugin  0.1.0
detection_model_centernet.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 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 <memory>
19 #include <string>
20 #include <vector>
21 
22 #include "models/detection_model.h"
23 
24 namespace ov {
25 class InferRequest;
26 class Model;
27 } // namespace ov
28 struct InferenceResult;
29 struct InputData;
30 struct InternalModelData;
31 struct ResultBase;
32 
34 public:
35  struct BBox {
36  float left;
37  float top;
38  float right;
39  float bottom;
40 
41  float getWidth() const {
42  return (right - left) + 1.0f;
43  }
44  float getHeight() const {
45  return (bottom - top) + 1.0f;
46  }
47  };
48  static const int INIT_VECTOR_SIZE = 200;
49 
50  ModelCenterNet(const std::string& modelFileName,
51  float confidenceThreshold,
52  const std::vector<std::string>& labels = std::vector<std::string>(),
53  const std::string& layout = "");
54  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
55  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
56 
57 protected:
58  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
59 };
Definition: detection_model.h:25
Definition: detection_model_centernet.h:33
Definition: results.h:53
Definition: input_data.h:20
Definition: internal_model_data.h:19
Definition: detection_model_centernet.h:35
Definition: results.h:29