diff --git a/docs/source/docs/objectDetection/about-object-detection.md b/docs/source/docs/objectDetection/about-object-detection.md index e7f89755d0..5c5f547394 100644 --- a/docs/source/docs/objectDetection/about-object-detection.md +++ b/docs/source/docs/objectDetection/about-object-detection.md @@ -40,7 +40,7 @@ Coming soon! ## Uploading Custom Models :::{warning} -PhotonVision currently ONLY supports 640x640 YOLOv5 & YOLOv8 models trained and converted to `.rknn` format for RK3588 CPUs! Other models require different post-processing code and will NOT work. The model conversion process is also highly particular. Proceed with care. +PhotonVision currently ONLY supports 640x640 YOLOv5, YOLOv8, and YOLO11 models trained and converted to `.rknn` format for RK3588 CPUs! Other models require different post-processing code and will NOT work. The model conversion process is also highly particular. Proceed with care. ::: In the settings, under `Device Control`, there's an option to upload a new object detection model. Naming convention diff --git a/photon-core/src/main/java/org/photonvision/vision/objects/RknnModel.java b/photon-core/src/main/java/org/photonvision/vision/objects/RknnModel.java index 921b507948..0703e36253 100644 --- a/photon-core/src/main/java/org/photonvision/vision/objects/RknnModel.java +++ b/photon-core/src/main/java/org/photonvision/vision/objects/RknnModel.java @@ -39,6 +39,8 @@ public class RknnModel implements Model { * *

"yolov8" -> "YOLO_V8" * + *

"yolov11" -> "YOLO_V11" + * * @param modelName The model's filename * @return The model version */ @@ -48,6 +50,8 @@ private static RknnJNI.ModelVersion getModelVersion(String modelName) return RknnJNI.ModelVersion.YOLO_V5; } else if (modelName.contains("yolov8")) { return RknnJNI.ModelVersion.YOLO_V8; + } else if (modelName.contains("yolov11")) { + return RknnJNI.ModelVersion.YOLO_V11; } else { throw new IllegalArgumentException("Unknown model version for model " + modelName); } diff --git a/photon-server/src/main/java/org/photonvision/server/RequestHandler.java b/photon-server/src/main/java/org/photonvision/server/RequestHandler.java index 1a318b324f..338fbabaec 100644 --- a/photon-server/src/main/java/org/photonvision/server/RequestHandler.java +++ b/photon-server/src/main/java/org/photonvision/server/RequestHandler.java @@ -575,10 +575,11 @@ public static void onImportObjectDetectionModelRequest(Context ctx) { // verify naming convention // this check will need to be modified if different model types are added - Pattern modelPattern = Pattern.compile("^[a-zA-Z0-9]+-\\d+-\\d+-yolov[58][a-z]*\\.rknn$"); + Pattern modelPattern = + Pattern.compile("^[a-zA-Z0-9]+-\\d+-\\d+-yolov(?:5|8|11)[a-z]*\\.rknn$"); Pattern labelsPattern = - Pattern.compile("^[a-zA-Z0-9]+-\\d+-\\d+-yolov[58][a-z]*-labels\\.txt$"); + Pattern.compile("^[a-zA-Z0-9]+-\\d+-\\d+-yolov(?:5|8|11)[a-z]*-labels\\.txt$"); if (!modelPattern.matcher(modelFile.filename()).matches() || !labelsPattern.matcher(labelsFile.filename()).matches()