#include "yolo.hpp" #include #include "yolos/yolo11.hpp" #include "yolos/yolov5.hpp" #include "yolos/yolov8.hpp" namespace auto_aim { YOLO::YOLO(const std::string & config_path, bool debug) { auto yaml = YAML::LoadFile(config_path); auto yolo_name = yaml["yolo_name"].as(); if (yolo_name == "yolov8") { yolo_ = std::make_unique(config_path, debug); } else if (yolo_name == "yolo11") { yolo_ = std::make_unique(config_path, debug); } else if (yolo_name == "yolov5") { yolo_ = std::make_unique(config_path, debug); } else { throw std::runtime_error("Unknown yolo name: " + yolo_name + "!"); } } std::list YOLO::detect(const cv::Mat & img, int frame_count) { return yolo_->detect(img, frame_count); } std::list YOLO::postprocess( double scale, cv::Mat & output, const cv::Mat & bgr_img, int frame_count) { return yolo_->postprocess(scale, output, bgr_img, frame_count); } } // namespace auto_aim