Reference for ultralytics/models/rtdetr/val.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/rtdetr/val.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.rtdetr.val.RTDETRDataset
Bases: YOLODataset
Real-Time DEtection and TRacking (RT-DETR) dataset class extending the base YOLODataset class.
This specialized dataset class is designed for use with the RT-DETR object detection model and is optimized for real-time detection and tracking tasks.
Source code in ultralytics/models/rtdetr/val.py
build_transforms
Temporary, only for evaluation.
Source code in ultralytics/models/rtdetr/val.py
load_image
ultralytics.models.rtdetr.val.RTDETRValidator
Bases: DetectionValidator
RTDETRValidator extends the DetectionValidator class to provide validation capabilities specifically tailored for the RT-DETR (Real-Time DETR) object detection model.
The class allows building of an RTDETR-specific dataset for validation, applies Non-maximum suppression for post-processing, and updates evaluation metrics accordingly.
Example
Note
For further details on the attributes and methods, refer to the parent DetectionValidator class.
Source code in ultralytics/models/yolo/detect/val.py
build_dataset
Build an RTDETR Dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img_path
|
str
|
Path to the folder containing images. |
required |
mode
|
str
|
|
'val'
|
batch
|
int
|
Size of batches, this is for |
None
|
Source code in ultralytics/models/rtdetr/val.py
postprocess
Apply Non-maximum suppression to prediction outputs.