plugin  0.1.0
detection_model_yolox.h
1 /*
2 // Copyright (C) 2022-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 <openvino/openvino.hpp>
23 
24 #include "models/detection_model.h"
25 
26 class ModelYoloX: public DetectionModel {
27 public:
37  ModelYoloX(const std::string& modelFileName,
38  float confidenceThreshold,
39  float boxIOUThreshold = 0.5,
40  const std::vector<std::string>& labels = std::vector<std::string>(),
41  const std::string& layout = "");
42 
43  std::unique_ptr<ResultBase> postprocess(InferenceResult& infResult) override;
44  std::shared_ptr<InternalModelData> preprocess(const InputData& inputData, ov::InferRequest& request) override;
45 
46 protected:
47  void prepareInputsOutputs(std::shared_ptr<ov::Model>& model) override;
48  void setStridesGrids();
49 
50  float boxIOUThreshold;
51  std::vector<std::pair<size_t, size_t>> grids;
52  std::vector<size_t> expandedStrides;
53  static const size_t numberOfClasses = 80;
54 };
Definition: detection_model.h:25
Definition: detection_model_yolox.h:26
ModelYoloX(const std::string &modelFileName, float confidenceThreshold, float boxIOUThreshold=0.5, const std::vector< std::string > &labels=std::vector< std::string >(), const std::string &layout="")
Definition: detection_model_yolox.cpp:38
Definition: results.h:53
Definition: input_data.h:20