nndeploy C++ API  0.2.0
nndeploy C++ API
util.h
Go to the documentation of this file.
1 
2 #ifndef _NNDEPLOY_DETECT_DETECT_UTIL_H_
3 #define _NNDEPLOY_DETECT_DETECT_UTIL_H_
4 
5 #include "nndeploy/base/any.h"
6 #include "nndeploy/base/common.h"
8 #include "nndeploy/base/log.h"
9 #include "nndeploy/base/macro.h"
10 #include "nndeploy/base/object.h"
11 #include "nndeploy/base/param.h"
12 #include "nndeploy/base/status.h"
13 #include "nndeploy/base/string.h"
14 #include "nndeploy/base/type.h"
15 #include "nndeploy/detect/result.h"
16 #include "nndeploy/device/buffer.h"
17 #include "nndeploy/device/device.h"
19 #include "nndeploy/device/tensor.h"
20 
21 namespace nndeploy {
22 namespace detect {
23 
38 extern NNDEPLOY_CC_API std::array<float, 4> getOriginBox(
39  float xmin, float ymin, float xmax, float ymax, const float *scale_factor,
40  float x_offset, float y_offset, int ori_width, int ori_height);
41 
53 extern NNDEPLOY_CC_API std::array<float, 4> getOriginBox(
54  const std::array<float, 4> &box, const float *scale_factor, float x_offset,
55  float y_offset, int ori_width, int ori_height);
56 
70 float computeIOU(float xmin0, float ymin0, float xmax0, float ymax0,
71  float xmin1, float ymin1, float xmax1, float ymax1);
72 
80 float computeIOU(const std::array<float, 4> &box0,
81  const std::array<float, 4> &box1);
82 
91 float computeIOU(const float *boxes, int i, int j);
92 
101 base::Status computeNMS(const DetectResult &src, std::vector<int> &keep_idxs,
102  const float iou_threshold);
103 
104 base::Status fastNMS(const DetectResult &src, std::vector<int> &keep_idxs,
105  const float iou_threshold);
106 
107 } // namespace detect
108 } // namespace nndeploy
109 
110 #endif /* _NNDEPLOY_DETECT_DETECT_COMMON_H_ */
#define NNDEPLOY_CC_API
api
Definition: macro.h:29
base::Status computeNMS(const DetectResult &src, std::vector< int > &keep_idxs, const float iou_threshold)
float computeIOU(float xmin0, float ymin0, float xmax0, float ymax0, float xmin1, float ymin1, float xmax1, float ymax1)
base::Status fastNMS(const DetectResult &src, std::vector< int > &keep_idxs, const float iou_threshold)
std::array< float, 4 > getOriginBox(float xmin, float ymin, float xmax, float ymax, const float *scale_factor, float x_offset, float y_offset, int ori_width, int ori_height)
Get the Origin Box object.