From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/namespaceyolov3.xhtml | 274 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 21.02/namespaceyolov3.xhtml (limited to '21.02/namespaceyolov3.xhtml') diff --git a/21.02/namespaceyolov3.xhtml b/21.02/namespaceyolov3.xhtml new file mode 100644 index 0000000000..a616e3431f --- /dev/null +++ b/21.02/namespaceyolov3.xhtml @@ -0,0 +1,274 @@ + + + + + + + + + + + + + +ArmNN: yolov3 Namespace Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
yolov3 Namespace Reference
+
+
+ + + + + + + + + + + +

+Classes

struct  Box
 Box representation structure. More...
 
struct  Detection
 Detection structure. More...
 
struct  NMSConfig
 Non Maxima Suprresion configuration meta-data. More...
 
+ + + + + + + + + + +

+Functions

bool compare_detection (const yolov3::Detection &detection, const std::vector< float > &expected)
 Compare a detection object with a vector of float values. More...
 
void print_detection (std::ostream &os, const std::vector< Detection > &detections)
 Print identified yolo detections. More...
 
std::vector< Detectionnms (const NMSConfig &config, const std::vector< float > &detected_boxes)
 Perform Non-Maxima Supression on a list of given detections. More...
 
+

Function Documentation

+ +

◆ compare_detection()

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool compare_detection (const yolov3::Detectiondetection,
const std::vector< float > & expected 
)
+
+ +

Compare a detection object with a vector of float values.

+
Parameters
+ + + +
detection[in] Detection object
expected[in] Vector of expected float values
+
+
+
Returns
Boolean to represent if they match or not
+ +

Definition at line 84 of file NMS.cpp.

+ +

References Detection::box, Detection::classes, Detection::confidence, Box::xmax, Box::xmin, Box::ymax, and Box::ymin.

+ +

Referenced by CheckAccuracy().

+
86 {
87  float tolerance = 0.001f;
88  return (std::fabs(detection.classes[0] - expected[0]) < tolerance &&
89  std::fabs(detection.box.xmin - expected[1]) < tolerance &&
90  std::fabs(detection.box.ymin - expected[2]) < tolerance &&
91  std::fabs(detection.box.xmax - expected[3]) < tolerance &&
92  std::fabs(detection.box.ymax - expected[4]) < tolerance &&
93  std::fabs(detection.confidence - expected[5]) < tolerance );
94 }
float confidence
Confidence of detection.
Definition: NMS.hpp:31
+
float ymin
Y-pos position of the low left coordinate.
Definition: NMS.hpp:24
+
float xmin
X-pos position of the low left coordinate.
Definition: NMS.hpp:22
+
float xmax
X-pos position of the top right coordinate.
Definition: NMS.hpp:23
+
std::vector< float > classes
Probability of classes.
Definition: NMS.hpp:32
+
Box box
Detection box.
Definition: NMS.hpp:30
+
float ymax
Y-pos position of the top right coordinate.
Definition: NMS.hpp:25
+
+
+
+ +

◆ nms()

+ +
+
+ + + + + + + + + + + + + + + + + + +
std::vector< Detection > nms (const NMSConfigconfig,
const std::vector< float > & detected_boxes 
)
+
+ +

Perform Non-Maxima Supression on a list of given detections.

+
Parameters
+ + + +
[in]configConfiguration metadata for NMS
[in]detected_boxesDetected boxes
+
+
+
Returns
A vector with the final detections
+ +

Definition at line 113 of file NMS.cpp.

+ +

References Detection::classes, NMSConfig::iou_threshold, and NMSConfig::num_classes.

+
114  {
115  // Get detections that comply with the expected confidence threshold
116  std::vector<Detection> detections =
117  convert_to_detections(config, detected_boxes);
118 
119  const unsigned int num_detections = static_cast<unsigned int>(detections.size());
120  for (unsigned int c = 0; c < config.num_classes; ++c)
121  {
122  // Sort classes
123  std::sort(detections.begin(), detections.begin() + static_cast<std::ptrdiff_t>(num_detections),
124  [c](Detection& detection1, Detection& detection2)
125  {
126  return (detection1.classes[c] - detection2.classes[c]) > 0;
127  });
128  // Clear detections with high IoU
129  for (unsigned int d = 0; d < num_detections; ++d)
130  {
131  // Check if class is already cleared/invalidated
132  if (detections[d].classes[c] == 0.f)
133  {
134  continue;
135  }
136 
137  // Filter out boxes on IoU threshold
138  const Box& box1 = detections[d].box;
139  for (unsigned int b = d + 1; b < num_detections; ++b)
140  {
141  const Box& box2 = detections[b].box;
142  if (iou(box1, box2) > config.iou_threshold)
143  {
144  detections[b].classes[c] = 0.f;
145  }
146  }
147  }
148  }
149  return detections;
150 }
+
+
+ +

◆ print_detection()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void print_detection (std::ostream & os,
const std::vector< Detection > & detections 
)
+
+ +

Print identified yolo detections.

+
Parameters
+ + + +
[in,out]osOutput stream to print to
[in]detectionsDetections to print
+
+
+ +

Definition at line 96 of file NMS.cpp.

+
98 {
99  for (const auto& detection : detections)
100  {
101  for (unsigned int c = 0; c < detection.classes.size(); ++c)
102  {
103  if (detection.classes[c] != 0.0f)
104  {
105  os << c << " " << detection.classes[c] << " " << detection.box.xmin
106  << " " << detection.box.ymin << " " << detection.box.xmax << " "
107  << detection.box.ymax << std::endl;
108  }
109  }
110  }
111 }
+
+
+
+
+ + + + -- cgit v1.2.1