> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# RT-DETR 

The `RT_DETR` class implements a wrapper for the RT\_DETR model, which detects objects in images and videos using a real-time detection transformer.

<ResponseField name="class RT_DETR()">
  <ResponseField name="use_local" type="boolean" default="False">
    If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to True.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  <ResponseField name="input" type="Union[np.ndarray, str]" required="True">
    The image array or path to the video file for object detection.
  </ResponseField>

  <ResponseField name="confidence_threshold" type="float" required="True">
    Confidence threshold for filtering object detection results.
  </ResponseField>

  <ResponseField name="Returns" type="np.ndarray">
    Annotated image with bounding boxes and class labels.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.perception.detection.rt_detr import RT_DETR
  import rerun as rr
  car = AirGenCar()

  # We will be capturing an image from the AirGen simulator 
  # and run model inference on it.

  img =  car.getImage("front_center", "rgb").data

  model = RT_DETR(use_local=False)
  result = model.run(input=img.copy(), confidence_threshold=0.5)
  rr.log("result",rr.Image(result))
  ```
</RequestExample>

<Tabs>
  <Tab title="License">
    This code is licensed under the Apache 2.0 License.
  </Tab>

  <Tab title="Source">
    [https://github.com/lyuwenyu/RT-DETR](https://github.com/lyuwenyu/RT-DETR)
  </Tab>
</Tabs>
