Compare commits

..

No commits in common. "c3410cd13eef70b5dbbaaa3f6e86e5ff3bb82740" and "23b32cbacfe65d37461cf0591fc87a1e2208757d" have entirely different histories.

2 changed files with 29 additions and 24 deletions

View File

@ -365,8 +365,8 @@ detectors:
model: model:
model_type: rfdetr model_type: rfdetr
width: 320 width: 560
height: 320 height: 560
input_tensor: nchw input_tensor: nchw
input_dtype: float input_dtype: float
path: /config/model_cache/rfdetr.onnx path: /config/model_cache/rfdetr.onnx
@ -616,8 +616,8 @@ detectors:
model: model:
model_type: rfdetr model_type: rfdetr
width: 320 width: 560
height: 320 height: 560
input_tensor: nchw input_tensor: nchw
input_dtype: float input_dtype: float
path: /config/model_cache/rfdetr.onnx path: /config/model_cache/rfdetr.onnx
@ -983,21 +983,22 @@ Make sure you change the batch size to 1 before exporting.
### Download RF-DETR Model ### Download RF-DETR Model
RF-DETR can be exported as ONNX by running the command below. You can copy and paste the whole thing to your terminal and execute, altering `MODEL_SIZE=Nano` in the first line to `Nano`, `Small`, or `Medium` size. To export as ONNX:
```sh 1. `pip3 install rfdetr`
docker build . --build-arg MODEL_SIZE=Nano --output . -f- <<'EOF' 2. `python3`
FROM python:3.11 AS build 3. `from rfdetr import RFDETRBase`
RUN apt-get update && apt-get install --no-install-recommends -y libgl1 && rm -rf /var/lib/apt/lists/* 4. `x = RFDETRBase()`
COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/ 5. `x.export()`
WORKDIR /rfdetr
RUN uv pip install --system rfdetr onnx onnxruntime onnxsim onnx-graphsurgeon #### Additional Configuration
ARG MODEL_SIZE
RUN python3 -c "from rfdetr import RFDETR${MODEL_SIZE}; x = RFDETR${MODEL_SIZE}(resolution=320); x.export()" The input tensor resolution can be customized:
FROM scratch
ARG MODEL_SIZE ```python
COPY --from=build /rfdetr/output/inference_model.onnx /rfdetr-${MODEL_SIZE}.onnx from rfdetr import RFDETRBase
EOF x = RFDETRBase(resolution=560) # resolution must be a multiple of 56
x.export()
``` ```
### Downloading YOLO-NAS Model ### Downloading YOLO-NAS Model

View File

@ -166,12 +166,16 @@ There are improved capabilities in newer GPU architectures that TensorRT can ben
Inference speeds will vary greatly depending on the GPU and the model used. Inference speeds will vary greatly depending on the GPU and the model used.
`tiny` variants are faster than the equivalent non-tiny model, some known examples are below: `tiny` variants are faster than the equivalent non-tiny model, some known examples are below:
| Name | YOLOv9 Inference Time | YOLO-NAS Inference Time | RF-DETR Inference Time | | Name | YOLOv7 Inference Time | YOLO-NAS Inference Time | RF-DETR Inference Time |
| --------------- | --------------------- | ------------------------- | ---------------------- | | --------------- | --------------------- | ------------------------- | ------------------------- |
| RTX 3050 | t-320: 15 ms | 320: ~ 10 ms 640: ~ 16 ms | Nano-320: ~ 12 ms | | GTX 1060 6GB | ~ 7 ms | | |
| RTX 3070 | t-320: 11 ms | 320: ~ 8 ms 640: ~ 14 ms | Nano-320: ~ 9 ms | | GTX 1070 | ~ 6 ms | | |
| RTX A4000 | | 320: ~ 15 ms | | | GTX 1660 SUPER | ~ 4 ms | | |
| Tesla P40 | | 320: ~ 105 ms | | | RTX 3050 | 5 - 7 ms | 320: ~ 10 ms 640: ~ 16 ms | 336: ~ 16 ms 560: ~ 40 ms |
| RTX 3070 Mobile | ~ 5 ms | | |
| RTX 3070 | 4 - 6 ms | 320: ~ 6 ms 640: ~ 12 ms | 336: ~ 14 ms 560: ~ 36 ms |
| Quadro P400 2GB | 20 - 25 ms | | |
| Quadro P2000 | ~ 12 ms | | |
### ROCm - AMD GPU ### ROCm - AMD GPU