7 #ifndef TURI_OBJECT_DETECTION_OD_YOLO_H_ 8 #define TURI_OBJECT_DETECTION_OD_YOLO_H_ 10 #include <ml/neural_net/image_augmentation.hpp> 11 #include <ml/neural_net/model_spec.hpp> 14 namespace object_detection {
32 void convert_annotations_to_yolo(
33 const std::vector<neural_net::image_annotation>& annotations,
34 size_t output_height,
size_t output_width,
size_t num_anchors,
35 size_t num_classes,
float* out);
49 std::vector<neural_net::image_annotation> convert_yolo_to_annotations(
50 const neural_net::float_array& yolo_map,
51 const std::vector<std::pair<float, float>>& anchor_boxes,
52 float min_confidence);
80 void add_yolo(neural_net::model_spec* nn_spec,
const std::string& coordinates_name,
81 const std::string& confidence_name,
const std::string& input,
82 const std::vector<std::pair<float, float>>& anchor_boxes,
size_t num_classes,
83 bool use_nms_layer,
float iou_threshold,
float confidence_threshold,
84 size_t output_grid_height,
size_t output_grid_width);
107 void apply_nms_layer(neural_net::model_spec* nn_spec,
const std::string& coordinates_name,
108 const std::string& confidence_name,
const std::string& prefix,
109 size_t num_bounding_boxes,
size_t num_classes,
float confidence_threshold,
110 float iou_threshold,
size_t nms_boxes,
bool use_most_confident_class);
115 #endif // TURI_OBJECT_DETECTION_OD_YOLO_H_