Reference for ultralytics/models/rtdetr/predict.py
Note
Full source code for this file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/predict.py. Help us fix any issues you see by submitting a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.rtdetr.predict.RTDETRPredictor
Bases: BasePredictor
A class extending the BasePredictor class for prediction based on an RT-DETR detection model.
Example
Source code in ultralytics/models/rtdetr/predict.py
postprocess(preds, img, orig_imgs)
Postprocess predictions and returns a list of Results objects.
Source code in ultralytics/models/rtdetr/predict.py
pre_transform(im)
Pre-transform input image before inference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
im |
List(np.ndarray
|
(N, 3, h, w) for tensor, [(h, w, 3) x N] for list. |
required |
Notes: The size must be square(640) and scaleFilled.
Returns:
Type | Description |
---|---|
list
|
A list of transformed imgs. |