MCPcopy Create free account
hub / github.com/developer0hye/Yolo_Label / detectVersionFromMetadata

Method detectVersionFromMetadata

yolo_detector.cpp:147–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147YoloVersion 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
164void YoloDetector::readMetadata()
165{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected