| 145 | } |
| 146 | |
| 147 | YoloVersion YoloDetector::detectVersionFromMetadata(YoloVersion fallback) |
| 148 | { |
| 149 | // Try to determine specific YOLO version from metadata description |
| 150 | // Ultralytics sets description like "Ultralytics YOLOv8n model" or "Ultralytics YOLO11n model" |
| 151 | const std::string& desc = m_metadata.description; |
| 152 | if (!desc.empty()) { |
| 153 | // Check for newer versions first (higher number = check first) |
| 154 | if (desc.find("YOLOv26") != std::string::npos || desc.find("YOLO26") != std::string::npos) |
| 155 | return YoloVersion::V26; |
| 156 | if (desc.find("YOLO12") != std::string::npos) return YoloVersion::V12; |
| 157 | if (desc.find("YOLO11") != std::string::npos) return YoloVersion::V11; |
| 158 | if (desc.find("YOLOv8") != std::string::npos) return YoloVersion::V8; |
| 159 | if (desc.find("YOLOv5") != std::string::npos) return YoloVersion::V5; |
| 160 | } |
| 161 | return fallback; |
| 162 | } |
| 163 | |
| 164 | void YoloDetector::readMetadata() |
| 165 | { |
nothing calls this directly
no outgoing calls
no test coverage detected