From e1aec6ac0ff99f6ff227a890e5c57d09b2cdc559 Mon Sep 17 00:00:00 2001 From: "yanlong.hao" Date: Tue, 6 Feb 2024 02:46:04 +0000 Subject: [PATCH 1/3] Add detection model of pp_yoloe+. --- cv/detection/pp_yoloe+/paddlepaddle/README.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 cv/detection/pp_yoloe+/paddlepaddle/README.md diff --git a/cv/detection/pp_yoloe+/paddlepaddle/README.md b/cv/detection/pp_yoloe+/paddlepaddle/README.md new file mode 100644 index 000000000..6f02f42df --- /dev/null +++ b/cv/detection/pp_yoloe+/paddlepaddle/README.md @@ -0,0 +1,50 @@ +# PP-YOLOE+ + +## Model description +- Pre training model using large-scale data set obj365 +- In the backbone, add the alpha parameter to the block branch +- Optimize the end-to-end inference speed and improve the training convergence speed + +## Step 1: Installing +``` +git clone -b develop https://github.com/PaddlePaddle/PaddleYOLO.git +``` + +``` +cd PaddleYOLO +pip3 install -r requirements.txt +``` + +## Step 2: Prepare Datasets +``` +python3 dataset/coco/download_coco.py +``` + +## Step 3: Training + +``` +cd PaddleYOLO + +model_name=ppyoloe # 可修改,如 yolov7 +job_name=ppyoloe_plus_crn_s_80e_coco # 可修改,如 yolov7_tiny_300e_coco + +config=configs/${model_name}/${job_name}.yml +log_dir=log_dir/${job_name} +# weights=https://bj.bcebos.com/v1/paddledet/models/${job_name}.pdparams +weights=output/${job_name}/model_final.pdparams + +# 1.训练(单卡/多卡),加 --eval 表示边训边评估,加 --amp 表示混合精度训练 +CUDA_VISIBLE_DEVICES=0 python3 tools/train.py -c ${config} --eval --amp +# python3 -m paddle.distributed.launch --log_dir=${log_dir} --gpus 0,1,2,3,4,5,6,7 tools/train.py -c ${config} --eval --amp + +# 2.评估,加 --classwise 表示输出每一类mAP +# CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c ${config} -o weights=${weights} --classwise + +# 3.预测 (单张图/图片文件夹) +# CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c ${config} -o weights=${weights} --infer_img=demo/000000014439_640x640.jpg --draw_threshold=0.5 +# CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c ${config} -o weights=${weights} --infer_dir=demo/ --draw_threshold=0.5 +``` + +## Reference +- [PaddleYOLO](https://github.com/PaddlePaddle/PaddleYOLO) +- [PP-YOLOE](https://arxiv.org/pdf/2203.16250v3.pdf) -- Gitee From 8d5757e169725a11f4cb52d12fbc5b9b903baecc Mon Sep 17 00:00:00 2001 From: majorli Date: Mon, 19 Feb 2024 15:48:11 +0800 Subject: [PATCH 2/3] update resutls Signed-off-by: majorli --- cv/detection/pp_yoloe+/paddlepaddle/README.md | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/cv/detection/pp_yoloe+/paddlepaddle/README.md b/cv/detection/pp_yoloe+/paddlepaddle/README.md index 6f02f42df..62d99dd03 100644 --- a/cv/detection/pp_yoloe+/paddlepaddle/README.md +++ b/cv/detection/pp_yoloe+/paddlepaddle/README.md @@ -1,50 +1,56 @@ # PP-YOLOE+ ## Model description -- Pre training model using large-scale data set obj365 -- In the backbone, add the alpha parameter to the block branch -- Optimize the end-to-end inference speed and improve the training convergence speed +PP-YOLOE is an excellent single-stage anchor-free model based on PP-YOLOv2, surpassing a variety of popular YOLO models. PP-YOLOE has a series of models, named s/m/l/x, which are configured through width multiplier and depth multiplier. PP-YOLOE avoids using special operators, such as Deformable Convolution or Matrix NMS, to be deployed friendly on various hardware. -## Step 1: Installing -``` -git clone -b develop https://github.com/PaddlePaddle/PaddleYOLO.git -``` +## Step 1: Installation -``` -cd PaddleYOLO +```bash +git clone -b release/2.7 https://github.com/PaddlePaddle/PaddleYOLO.git + +cd PaddleYOLO/ pip3 install -r requirements.txt ``` -## Step 2: Prepare Datasets -``` +## Step 2: Preparing datasets + +```bash python3 dataset/coco/download_coco.py ``` ## Step 3: Training -``` -cd PaddleYOLO - -model_name=ppyoloe # 可修改,如 yolov7 -job_name=ppyoloe_plus_crn_s_80e_coco # 可修改,如 yolov7_tiny_300e_coco +**HINT** +--eval: training with evaluation; --amp: Mixed-precision training +```bash +model_name=ppyoloe +job_name=ppyoloe_plus_crn_s_80e_coco config=configs/${model_name}/${job_name}.yml log_dir=log_dir/${job_name} -# weights=https://bj.bcebos.com/v1/paddledet/models/${job_name}.pdparams weights=output/${job_name}/model_final.pdparams +# weights=https://bj.bcebos.com/v1/paddledet/models/${job_name}.pdparams -# 1.训练(单卡/多卡),加 --eval 表示边训边评估,加 --amp 表示混合精度训练 +# Single card training CUDA_VISIBLE_DEVICES=0 python3 tools/train.py -c ${config} --eval --amp -# python3 -m paddle.distributed.launch --log_dir=${log_dir} --gpus 0,1,2,3,4,5,6,7 tools/train.py -c ${config} --eval --amp -# 2.评估,加 --classwise 表示输出每一类mAP -# CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c ${config} -o weights=${weights} --classwise +# Multi cards training +export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 +python3 -m paddle.distributed.launch --log_dir=${log_dir} --gpus 0,1,2,3,4,5,6,7 tools/train.py -c ${config} --eval --amp + +# Evaluation (--classwise: output mAP of each class) +CUDA_VISIBLE_DEVICES=0 python3 tools/eval.py -c ${config} -o weights=${weights} --classwise -# 3.预测 (单张图/图片文件夹) -# CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c ${config} -o weights=${weights} --infer_img=demo/000000014439_640x640.jpg --draw_threshold=0.5 -# CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c ${config} -o weights=${weights} --infer_dir=demo/ --draw_threshold=0.5 +# Inference (single picture or pictures path) +CUDA_VISIBLE_DEVICES=0 python3 tools/infer.py -c ${config} -o weights=${weights} --infer_img=demo/000000014439_640x640.jpg --draw_threshold=0.5 +# CUDA_VISIBLE_DEVICES=0 python3 tools/infer.py -c ${config} -o weights=${weights} --infer_dir=demo/ --draw_threshold=0.5 ``` +## Results +GPUs|FPS|ACC +----|---|--- +BI-V100 x8|ips:6.3293|Best test bbox ap: 0.528 + ## Reference - [PaddleYOLO](https://github.com/PaddlePaddle/PaddleYOLO) - [PP-YOLOE](https://arxiv.org/pdf/2203.16250v3.pdf) -- Gitee From 8b2dc0bc323fb9bfbe129d7fe12f025daa95f470 Mon Sep 17 00:00:00 2001 From: majorli Date: Mon, 19 Feb 2024 15:53:10 +0800 Subject: [PATCH 3/3] add PP-YOLOE+ to README.md Signed-off-by: majorli --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6a624d274..20412183a 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ DeepSparkHub甄选上百个应用算法和模型,覆盖AI和通用计算各领 [Oriented RepPoints](cv/detection/oriented_reppoints/pytorch/README.md) | PyTorch | DOTA [PP-PicoDet](cv/detection/picodet/paddlepaddle/README.md) | PaddlePaddle | COCO [PP-YOLOE](cv/detection/pp-yoloe/paddlepaddle/README.md) | PaddlePaddle | COCO +[PP-YOLOE+](cv/detection/pp_yoloe+/paddlepaddle/README.md) | PaddlePaddle | COCO [PVANet](cv/detection/pvanet/pytorch/README.md) | PyTorch | COCO [RepPoints](cv/detection/reppoints_mmdet/pytorch/README.md)  | PyTorch (MMDetection) | COCO [RetinaNet](cv/detection/retinanet/pytorch/README.md) | PyTorch | COCO -- Gitee