Add support for RF-DETR models (#17298)

* Add support for rf-detr models

* Add docs for rf-detr model

* Cleanup
This commit is contained in:
Nicolas Mowen
2025-03-21 18:55:46 -06:00
committed by GitHub
parent 4e83237d47
commit 48e4c44b32
4 changed files with 97 additions and 5 deletions

View File

@@ -342,7 +342,7 @@ Note that the labelmap uses a subset of the complete COCO label set that has onl
#### D-FINE
[D-FINE](https://github.com/Peterande/D-FINE) is the [current state of the art](https://paperswithcode.com/sota/real-time-object-detection-on-coco?p=d-fine-redefine-regression-task-in-detrs-as) at the time of writing. The ONNX exported models are supported, but not included by default. See [the models section](#downloading-d-fine-model) for more information on downloading the D-FINE model for use in Frigate.
[D-FINE](https://github.com/Peterande/D-FINE) is a DETR based model. The ONNX exported models are supported, but not included by default. See [the models section](#downloading-d-fine-model) for more information on downloading the D-FINE model for use in Frigate.
After placing the downloaded onnx model in your config/model_cache folder, you can use the following configuration:
@@ -647,9 +647,29 @@ model:
Note that the labelmap uses a subset of the complete COCO label set that has only 80 objects.
#### RF-DETR
[RF-DETR](https://github.com/roboflow/rf-detr) is a DETR based model. The ONNX exported models are supported, but not included by default. See [the models section](#downloading-rf-detr-model) for more informatoin on downloading the RF-DETR model for use in Frigate.
After placing the downloaded onnx model in your `config/model_cache` folder, you can use the following configuration:
```
detectors:
onnx:
type: onnx
model:
model_type: rfdetr
width: 560
height: 560
input_tensor: nchw
input_dtype: float
path: /config/model_cache/rfdetr.onnx
```
#### D-FINE
[D-FINE](https://github.com/Peterande/D-FINE) is the [current state of the art](https://paperswithcode.com/sota/real-time-object-detection-on-coco?p=d-fine-redefine-regression-task-in-detrs-as) at the time of writing. The ONNX exported models are supported, but not included by default. See [the models section](#downloading-d-fine-model) for more information on downloading the D-FINE model for use in Frigate.
[D-FINE](https://github.com/Peterande/D-FINE) is a DETR based model. The ONNX exported models are supported, but not included by default. See [the models section](#downloading-d-fine-model) for more information on downloading the D-FINE model for use in Frigate.
After placing the downloaded onnx model in your config/model_cache folder, you can use the following configuration:
@@ -873,6 +893,16 @@ Make sure you change the batch size to 1 before exporting.
:::
### Download RF-DETR Model
To export as ONNX:
1. `pip3 install rfdetr`
2. `python`
3. `from rfdetr import RFDETRBase`
4. `x = RFDETRBase()`
5. `x.export()`
### Downloading YOLO-NAS Model
You can build and download a compatible model with pre-trained weights using [this notebook](https://github.com/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb).