简体中文 | English
The object detection module is a crucial component in computer vision systems, responsible for locating and marking regions containing specific objects in images or videos. The performance of this module directly impacts the accuracy and efficiency of the entire computer vision system. The object detection module typically outputs bounding boxes for the target regions, which are then passed as input to the object recognition module for further processing.
| Model | mAP(%) | GPU Inference Time (ms) | CPU Inference Time (ms) | Model Storage Size (M) | Description |
|---|---|---|---|---|---|
| PicoDet-L | 42.6 | 16.6715 | 169.904 | 20.9 M | PP-PicoDet is a lightweight object detection algorithm for full-size, wide-angle targets, considering the computational capacity of mobile devices. Compared to traditional object detection algorithms, PP-PicoDet has a smaller model size and lower computational complexity, achieving higher speed and lower latency while maintaining detection accuracy. |
| PicoDet-S | 29.1 | 14.097 | 37.6563 | 4.4 M | |
| PP-YOLOE_plus-L | 52.9 | 33.5644 | 814.825 | 185.3 M | PP-YOLOE_plus is an upgraded version of the high-precision cloud-edge integrated model PP-YOLOE, developed by Baidu's PaddlePaddle vision team. By using the large-scale Objects365 dataset and optimizing preprocessing, it significantly enhances the model's end-to-end inference speed. |
| PP-YOLOE_plus-S | 43.7 | 16.8884 | 223.059 | 28.3 M | |
| RT-DETR-H | 56.3 | 114.814 | 3933.39 | 435.8 M | RT-DETR is the first real-time end-to-end object detector. The model features an efficient hybrid encoder to meet both model performance and throughput requirements, efficiently handling multi-scale features, and proposes an accelerated and optimized query selection mechanism to optimize the dynamics of decoder queries. RT-DETR supports flexible end-to-end inference speeds by using different decoders. |
| RT-DETR-L | 53.0 | 34.5252 | 1454.27 | 113.7 M |
❗ The above list features the 6 core models that the image classification module primarily supports. In total, this module supports 37 models. The complete list of models is as follows:
| Model | mAP(%) | GPU Inference Time (ms) | CPU Inference Time (ms) | Model Size (M) | Description |
|---|---|---|---|---|---|
| Cascade-FasterRCNN-ResNet50-FPN | 41.1 | - | - | 245.4 M | Cascade-FasterRCNN is an improved version of the Faster R-CNN object detection model. By coupling multiple detectors and optimizing detection results using different IoU thresholds, it addresses the mismatch problem between training and prediction stages, enhancing the accuracy of object detection. |
| Cascade-FasterRCNN-ResNet50-vd-SSLDv2-FPN | 45.0 | - | - | 246.2 M | |
| CenterNet-DLA-34 | 37.6 | - | - | 75.4 M | CenterNet is an anchor-free object detection model that treats the keypoints of the object to be detected as a single point—the center point of its bounding box, and performs regression through these keypoints. |
| CenterNet-ResNet50 | 38.9 | - | - | 319.7 M | |
| DETR-R50 | 42.3 | 59.2132 | 5334.52 | 159.3 M | DETR is a transformer-based object detection model proposed by Facebook. It achieves end-to-end object detection without the need for predefined anchor boxes or NMS post-processing strategies. |
| FasterRCNN-ResNet34-FPN | 37.8 | - | - | 137.5 M | Faster R-CNN is a typical two-stage object detection model that first generates region proposals and then performs classification and regression on these proposals. Compared to its predecessors R-CNN and Fast R-CNN, Faster R-CNN's main improvement lies in the region proposal aspect, using a Region Proposal Network (RPN) to provide region proposals instead of traditional selective search. RPN is a Convolutional Neural Network (CNN) that shares convolutional features with the detection network, reducing the computational overhead of region proposals. |
| FasterRCNN-ResNet50-FPN | 38.4 | - | - | 148.1 M | |
| FasterRCNN-ResNet50-vd-FPN | 39.5 | - | - | 148.1 M | |
| FasterRCNN-ResNet50-vd-SSLDv2-FPN | 41.4 | - | - | 148.1 M | |
| FasterRCNN-ResNet50 | 36.7 | - | - | 120.2 M | |
| FasterRCNN-ResNet101-FPN | 41.4 | - | - | 216.3 M | |
| FasterRCNN-ResNet101 | 39.0 | - | - | 188.1 M | |
| FasterRCNN-ResNeXt101-vd-FPN | 43.4 | - | - | 360.6 M | |
| FasterRCNN-Swin-Tiny-FPN | 42.6 | - | - | 159.8 M | |
| FCOS-ResNet50 | 39.6 | 103.367 | 3424.91 | 124.2 M | FCOS is an anchor-free object detection model that performs dense predictions. It uses the backbone of RetinaNet and directly regresses the width and height of the target object on the feature map, predicting the object's category and centerness (the degree of offset of pixels on the feature map from the object's center), which is eventually used as a weight to adjust the object score. |
| PicoDet-L | 42.6 | 16.6715 | 169.904 | 20.9 M | PP-PicoDet is a lightweight object detection algorithm designed for full-size and wide-aspect-ratio targets, with a focus on mobile device computation. Compared to traditional object detection algorithms, PP-PicoDet boasts smaller model sizes and lower computational complexity, achieving higher speeds and lower latency while maintaining detection accuracy. |
| PicoDet-M | 37.5 | 16.2311 | 71.7257 | 16.8 M | |
| PicoDet-S | 29.1 | 14.097 | 37.6563 | 4.4 M | |
| PicoDet-XS | 26.2 | 13.8102 | 48.3139 | 5.7 M | |
| PP-YOLOE_plus-L | 52.9 | 33.5644 | 814.825 | 185.3 M | PP-YOLOE_plus is an iteratively optimized and upgraded version of PP-YOLOE, a high-precision cloud-edge integrated model developed by Baidu PaddlePaddle's Vision Team. By leveraging the large-scale Objects365 dataset and optimizing preprocessing, it significantly enhances the end-to-end inference speed of the model. |
| PP-YOLOE_plus-M | 49.8 | 19.843 | 449.261 | 82.3 M | |
| PP-YOLOE_plus-S | 43.7 | 16.8884 | 223.059 | 28.3 M | |
| PP-YOLOE_plus-X | 54.7 | 57.8995 | 1439.93 | 349.4 M | |
| RT-DETR-H | 56.3 | 114.814 | 3933.39 | 435.8 M | RT-DETR is the first real-time end-to-end object detector. It features an efficient hybrid encoder that balances model performance and throughput, efficiently processes multi-scale features, and introduces an accelerated and optimized query selection mechanism to dynamize decoder queries. RT-DETR supports flexible end-to-end inference speeds through the use of different decoders. |
| RT-DETR-L | 53.0 | 34.5252 | 1454.27 | 113.7 M | |
| RT-DETR-R18 | 46.5 | 19.89 | 784.824 | 70.7 M | |
| RT-DETR-R50 | 53.1 | 41.9327 | 1625.95 | 149.1 M | |
| RT-DETR-X | 54.8 | 61.8042 | 2246.64 | 232.9 M | |
| YOLOv3-DarkNet53 | 39.1 | 40.1055 | 883.041 | 219.7 M | YOLOv3 is a real-time end-to-end object detector that utilizes a unique single Convolutional Neural Network (CNN) to frame the object detection problem as a regression task, enabling real-time detection. The model employs multi-scale detection to enhance performance across different object sizes. |
| YOLOv3-MobileNetV3 | 31.4 | 18.6692 | 267.214 | 83.8 M | |
| YOLOv3-ResNet50_vd_DCN | 40.6 | 31.6276 | 856.047 | 163.0 M | |
| YOLOX-L | 50.1 | 185.691 | 1250.58 | 192.5 M | Building upon YOLOv3's framework, YOLOX significantly boosts detection performance in complex scenarios by incorporating Decoupled Head, Data Augmentation, Anchor Free, and SimOTA components. |
| YOLOX-M | 46.9 | 123.324 | 688.071 | 90.0 M | |
| YOLOX-N | 26.1 | 79.1665 | 155.59 | 3.4 M | |
| YOLOX-S | 40.4 | 184.828 | 474.446 | 32.0 M | |
| YOLOX-T | 32.9 | 102.748 | 212.52 | 18.1 M | |
| YOLOX-X | 51.8 | 227.361 | 2067.84 | 351.5 M |
❗ Before proceeding with quick integration, please install the PaddleX wheel package. For detailed instructions, refer to the PaddleX Local Installation Guide.
After installing the wheel package, you can perform object detection inference with just a few lines of code. You can easily switch between models within the module and integrate the object detection inference into your projects. Before running the following code, please download the demo image to your local machine.
from paddlex import create_model
model = create_model("PicoDet-S")
output = model.predict("general_object_detection_002.png", batch_size=1)
for res in output:
res.print(json_format=False)
res.save_to_img("./output/")
res.save_to_json("./output/res.json")
For more information on using PaddleX's single-model inference APIs, refer to the PaddleX Single Model Python Script Usage Instructions.
If you seek higher precision from existing models, you can leverage PaddleX's custom development capabilities to develop better object detection models. Before developing object detection models with PaddleX, ensure you have installed the object detection related training plugins. For installation instructions, refer to the PaddleX Local Installation Guide.
Before model training, prepare the corresponding dataset for the task module. PaddleX provides a data validation feature for each module, and only datasets that pass validation can be used for model training. Additionally, PaddleX provides demo datasets for each module, which you can use to complete subsequent development. If you wish to use a private dataset for model training, refer to the PaddleX Object Detection Task Module Data Annotation Guide.
You can download the demo dataset to a specified folder using the following command:
wget https://paddle-model-ecology.bj.bcebos.com/paddlex/data/det_coco_examples.tar -P ./dataset
tar -xf ./dataset/det_coco_examples.tar -C ./dataset/
Validate your dataset with a single command:
python main.py -c paddlex/configs/object_detection/PicoDet-S.yaml \
-o Global.mode=check_dataset \
-o Global.dataset_dir=./dataset/det_coco_examples
After executing the above command, PaddleX will validate the dataset and summarize its basic information. If the command runs successfully, it will print Check dataset passed ! in the log. The validation results file is saved in ./output/check_dataset_result.json, and related outputs are saved in the ./output/check_dataset directory in the current directory, including visual examples of sample images and sample distribution histograms.
👉 Details of Validation Results (Click to Expand)
The specific content of the validation result file is:
{
"done_flag": true,
"check_pass": true,
"attributes": {
"num_classes": 4,
"train_samples": 701,
"train_sample_paths": [
"check_dataset/demo_img/road839.png",
"check_dataset/demo_img/road363.png",
"check_dataset/demo_img/road148.png",
"check_dataset/demo_img/road237.png",
"check_dataset/demo_img/road733.png",
"check_dataset/demo_img/road861.png",
"check_dataset/demo_img/road762.png",
"check_dataset/demo_img/road515.png",
"check_dataset/demo_img/road754.png",
"check_dataset/demo_img/road173.png"
],
"val_samples": 176,
"val_sample_paths": [
"check_dataset/demo_img/road218.png",
"check_dataset/demo_img/road681.png",
"check_dataset/demo_img/road138.png",
"check_dataset/demo_img/road544.png",
"check_dataset/demo_img/road596.png",
"check_dataset/demo_img/road857.png",
"check_dataset/demo_img/road203.png",
"check_dataset/demo_img/road589.png",
"check_dataset/demo_img/road655.png",
"check_dataset/demo_img/road245.png"
]
},
"analysis": {
"histogram": "check_dataset/histogram.png"
},
"dataset_path": "./dataset/det_coco_examples",
"show_type": "image",
"dataset_type": "COCODetDataset"
}
In the above validation results, check_pass being True indicates that the dataset format meets the requirements. Explanations for other indicators are as follows:
attributes.num_classes: The number of classes in this dataset is 4;attributes.train_samples: The number of training samples in this dataset is 704;attributes.val_samples: The number of validation samples in this dataset is 176;attributes.train_sample_paths: A list of relative paths to the visualization images of training samples in this dataset;attributes.val_sample_paths: A list of relative paths to the visualization images of validation samples in this dataset;Additionally, the dataset verification also analyzes the distribution of sample numbers across all classes in the dataset and generates a histogram (histogram.png) for visualization:
After completing data validation, you can convert the dataset format and re-split the training/validation ratio by modifying the configuration file or appending hyperparameters.
Model training can be completed with a single command, taking the training of the object detection model PicoDet-S as an example:
python main.py -c paddlex/configs/object_detection/PicoDet-S.yaml \
-o Global.mode=train \
-o Global.dataset_dir=./dataset/det_coco_examples
The following steps are required:
.yaml configuration file path for the model (here it is PicoDet-S.yaml,When training other models, you need to specify the corresponding configuration files. The relationship between the model and configuration files can be found in the PaddleX Model List (CPU/GPU))-o Global.mode=train-o Global.dataset_dir.
Other related parameters can be set by modifying the Global and Train fields in the .yaml configuration file, or adjusted by appending parameters in the command line. For example, to specify training on the first two GPUs: -o Global.device=gpu:0,1; to set the number of training epochs to 10: -o Train.epochs_iters=10. For more modifiable parameters and their detailed explanations, refer to the configuration file instructions for the corresponding task module of the model PaddleX Common Configuration File Parameters.After completing model training, you can evaluate the specified model weights file on the validation set to verify the model's accuracy. Using PaddleX for model evaluation can be done with a single command:
python main.py -c paddlex/configs/object_detection/PicoDet-S.yaml \
-o Global.mode=evaluate \
-o Global.dataset_dir=./dataset/det_coco_examples
Similar to model training, the following steps are required:
.yaml configuration file path for the model (here it is PicoDet-S.yaml)-o Global.mode=evaluate-o Global.dataset_dir. Other related parameters can be set by modifying the Global and Evaluate fields in the .yaml configuration file. For details, refer to PaddleX Common Model Configuration File Parameter Description.After completing model training and evaluation, you can use the trained model weights for inference predictions or Python integration.
To perform inference predictions through the command line, use the following command. Before running the following code, please download the demo image to your local machine.
python main.py -c paddlex/configs/object_detection/PicoDet-S.yaml \
-o Global.mode=predict \
-o Predict.model_dir="./output/best_model/inference" \
-o Predict.input="general_object_detection_002.png"
Similar to model training and evaluation, the following steps are required:
Specify the .yaml configuration file path for the model (here it is PicoDet-S.yaml)
Specify the mode as model inference prediction: -o Global.mode=predict
Specify the model weights path: -o Predict.model_dir="./output/best_model/inference"
Specify the input data path: -o Predict.input="..."
Other related parameters can be set by modifying the Global and Predict fields in the .yaml configuration file. For details, refer to PaddleX Common Model Configuration File Parameter Description.
The model can be directly integrated into the PaddleX pipelines or directly into your own project.
1.Pipeline Integration
The object detection module can be integrated into the General Object Detection Pipeline of PaddleX. Simply replace the model path to update the object detection module of the relevant pipeline. In pipeline integration, you can use high-performance inference and service-oriented deployment to deploy your model.
2.Module Integration
The weights you produce can be directly integrated into the object detection module. Refer to the Python example code in Quick Integration, and simply replace the model with the path to your trained model.