Refactor yolov9 detector to support v3, v4, v7 as well (#17697)

* Implement blobbed yolov7 post processing and consolidate yolo implementation

* Update documentation

* Add repo

* fix name
This commit is contained in:
Nicolas Mowen
2025-04-14 16:05:41 -05:00
committed by GitHub
parent 4feba8bcf3
commit bd0ee86db9
5 changed files with 145 additions and 32 deletions
+3 -7
View File
@@ -13,7 +13,7 @@ from frigate.util.model import (
get_ort_providers,
post_process_dfine,
post_process_rfdetr,
post_process_yolov9,
post_process_yolo,
)
logger = logging.getLogger(__name__)
@@ -97,12 +97,8 @@ class ONNXDetector(DetectionApi):
x_max / self.w,
]
return detections
elif (
self.onnx_model_type == ModelTypeEnum.yolov9
or self.onnx_model_type == ModelTypeEnum.yologeneric
):
predictions: np.ndarray = tensor_output[0]
return post_process_yolov9(predictions, self.w, self.h)
elif self.onnx_model_type == ModelTypeEnum.yologeneric:
return post_process_yolo(tensor_output, self.w, self.h)
else:
raise Exception(
f"{self.onnx_model_type} is currently not supported for onnx. See the docs for more info on supported models."