plugin  0.1.0
detection_model_faceboxes.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 <stddef.h>
19 
20 #include <memory>
21 #include <string>
22 #include <utility>
23 #include <vector>
24 
25 #include <utils/nms.hpp>
26 
27 #include "models/detection_model.h"
28 
29 namespace ov {
30 class Model;
31 } // namespace ov
32 struct InferenceResult;
33 struct ResultBase;
34 
36 public:
37  static const int INIT_VECTOR_SIZE = 200;
38 
39  ModelFaceBoxes(const std::string& modelFileName,
40  float confidenceThreshold,
41  bool useAutoResize,
42  float boxIOUThreshold,
43  const std::string& layout = "");
44  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
45 
46 protected:
47  size_t maxProposalsCount;
48  const float boxIOUThreshold;
49  const std::vector<float> variance;
50  const std::vector<int> steps;
51  const std::vector<std::vector<int>> minSizes;
52  std::vector<Anchor> anchors;
53  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
54  void priorBoxes(const std::vector<std::pair<size_t, size_t>>& featureMaps);
55 };
Definition: detection_model.h:25
Definition: detection_model_faceboxes.h:35
Definition: results.h:53
Definition: results.h:29