Skip to content

Commit a2b7f3a

Browse files
committed
add yolo-pro support
1 parent d27b3d0 commit a2b7f3a

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

photon-client/src/components/settings/ObjectDetectionCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const handleBulkImport = () => {
227227
:items="
228228
useSettingsStore().general.supportedBackends?.includes('RKNN')
229229
? ['YOLOv5', 'YOLOv8', 'YOLO11']
230-
: ['YOLOv8', 'YOLO11']
230+
: ['YOLOv8', 'YOLO11', 'YOLO_PRO']
231231
"
232232
/>
233233
<v-btn

photon-client/src/types/SettingTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface ObjectDetectionModelProperties {
2121
resolutionWidth: number;
2222
resolutionHeight: number;
2323
family: "RKNN" | "RUBIK";
24-
version: "YOLOV5" | "YOLOV8" | "YOLOV11";
24+
version: "YOLOV5" | "YOLOV8" | "YOLOV11" | "YOLO_PRO";
2525
}
2626

2727
export interface MetricData {

photon-core/src/main/java/org/photonvision/common/configuration/NeuralNetworkModelManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ public String extension() {
244244
public enum Version {
245245
YOLOV5,
246246
YOLOV8,
247-
YOLOV11
247+
YOLOV11,
248+
YOLOV11_OBB, // Not yet supported
249+
YOLO_PRO
248250
}
249251

250252
/**

photon-core/src/main/java/org/photonvision/vision/objects/RubikModel.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public RubikModel(ModelProperties properties) throws IllegalArgumentException {
5151
throw new IllegalArgumentException("Model family must be RUBIK");
5252
}
5353

54-
if (properties.version() != Version.YOLOV8 && properties.version() != Version.YOLOV11) {
54+
if (properties.version() != Version.YOLOV8
55+
&& properties.version() != Version.YOLOV11
56+
&& properties.version() != Version.YOLO_PRO) {
5557
throw new IllegalArgumentException("Model version must be YOLOV8 or YOLOV11");
5658
}
5759

@@ -77,7 +79,9 @@ public ModelProperties getProperties() {
7779

7880
public ObjectDetector load() {
7981
return new RubikObjectDetector(
80-
this, new Size(this.properties.resolutionWidth(), this.properties.resolutionHeight()));
82+
this,
83+
new Size(this.properties.resolutionWidth(), this.properties.resolutionHeight()),
84+
this.properties.version().ordinal());
8185
}
8286

8387
public String toString() {

photon-server/src/main/java/org/photonvision/server/RequestHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ public static void onImportObjectDetectionModelRequest(Context ctx) {
571571
case "YOLOv5" -> NeuralNetworkModelManager.Version.YOLOV5;
572572
case "YOLOv8" -> NeuralNetworkModelManager.Version.YOLOV8;
573573
case "YOLO11" -> NeuralNetworkModelManager.Version.YOLOV11;
574+
case "YOLO_PRO" -> NeuralNetworkModelManager.Version.YOLO_PRO;
574575
// Add more versions as necessary for new models
575576
default -> {
576577
ctx.status(400);

0 commit comments

Comments
 (0)