The mainbody detection technology is currently a very widely used detection technology, which refers to the detect one or some mainbody objects in the picture, crop the corresponding area in the image and carry out recognition, thereby completing the entire recognition process. Mainbody detection is the first step of the recognition task, which can effectively improve the recognition accuracy.
This tutorial will introduce the dataset and model training for mainbody detection in PaddleClas.
The datasets we used for mainbody detection task are shown in the following table.
Dataset | Image number | Image number used in < >mainbody detection |
Scenarios | Dataset link |
---|---|---|---|---|
Objects365 | 170W | 6k | General Scenarios | link |
COCO2017 | 12W | 5k | General Scenarios | link |
iCartoonFace | 2k | 2k | Cartoon Face | link |
LogoDet-3k | 3k | 2k | Logo | link |
RPC | 3k | 3k | Product | link |
In the actual training process, all datasets are mixed together. Categories of all the labeled boxes are modified to the category foreground
, and the detection model we trained just contains one category (foreground
).
There are many types of object detection methods such as the commonly used two-stage detectors (FasterRCNN series, etc.), single-stage detectors (YOLO, SSD, etc.), anchor-free detectors (FCOS, etc.) and so on.
PP-YOLO is proposed by PaddleDetection. It deeply optimizes the yolov3 model from multiple perspectives such as backbone, data augmentation, regularization strategy, loss function, and post-processing. Finally, it reached the state of the art in terms of "speed-precision". Specifically, the optimization strategy is as follows.
- Better backbone: ResNet50vd-DCN
- Larger training batch size: 8 GPUs and mini-batch size as 24 on each GPU
- Drop Block
- Exponential Moving Average
- IoU Loss
- Grid Sensitive
- Matrix NMS
- CoordConv
- Spatial Pyramid Pooling
- Better ImageNet pretrain weights
For more information about PP-YOLO, you can refer to PP-YOLO tutorial
In the mainbody detection task, we use ResNet50vd-DCN
as our backbone for better performance. The config file is ppyolov2_r50vd_dcn_365e_coco.yml used for the model training, in which the dagtaset path is modified to the mainbody detection dataset.
The final inference model can be downloaded here.