Changing Inference Resolution with roboflow/inference for Models like rf-detr

Hello everyone,

I’m working with the roboflow/inference library and I’m looking for a way to change the inference resolution of a model, similar to the size argument in the transformers library or the imgsz argument in ultralytics.

Specifically, I’m using the rf-detr-medium model, which was trained on 640x640 images. I’d like to know if it’s possible to run inference on this model with a higher resolution, for example, 960x960.

To be clear, I’m not asking about preprocessing the input image before feeding it to the model. My question is about changing the actual resolution that the model’s architecture accepts during the inference process.

Here’s a basic code snippet of how I’m currently loading the model:

from inference import get_model

model = get_model("rfdetr-nano")

predictions = model.infer(image, confidence=0.5)[0]

Does the roboflow/inference library provide a direct way to specify the inference resolution when loading a model or calling the infer() method?

Any insights or examples would be greatly appreciated!

Great question! To have a model natively infer at 960x960, you can:

  • Upload a new dataset version resized to 960x960 in Roboflow
  • Train an RF-DETR medium model on that dataset
  • The resulting model will be compiled for 960x960 inference

No, unfortunately the Roboflow/inference library does not provide a direct way to specify the inference resolution when loading a model or calling the infer() method.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.