我是靠谱客的博主 强健薯片,最近开发中收集的这篇文章主要介绍PaddleDetection-PP-YOLOv2 模型,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

2021SC@SDUSC本周分析

PP-YOLO模型库 

ModelGPU numberimages/GPUbackboneinput shapeBox APvalBox APtestV100 FP32(FPS)V100 TensorRT FP16(FPS)downloadconfig
PP-YOLO824ResNet50vd60844.845.272.9155.6modelconfig
PP-YOLO824ResNet50vd51243.944.489.9188.4modelconfig
PP-YOLO824ResNet50vd41642.142.5109.1215.4modelconfig
PP-YOLO824ResNet50vd32038.939.3132.2242.2modelconfig
PP-YOLO_2x824ResNet50vd60845.345.972.9155.6modelconfig
PP-YOLO_2x824ResNet50vd51244.445.089.9188.4modelconfig
PP-YOLO_2x824ResNet50vd41642.743.2109.1215.4modelconfig
PP-YOLO_2x824ResNet50vd32039.540.1132.2242.2modelconfig
PP-YOLO432ResNet18vd51229.229.5357.1657.9modelconfig
PP-YOLO432ResNet18vd41628.628.9409.8719.4modelconfig
PP-YOLO432ResNet18vd32026.226.4480.7763.4modelconfig
PP-YOLOv2812ResNet50vd64049.149.568.9106.5modelconfig
PP-YOLOv2812ResNet101vd64049.750.349.587.0modelconfig

修改配置文件ppyolov2_r50vd_dcn_365e_coco.yml

_BASE_: [
  '../datasets/coco_detection.yml',
  '../runtime.yml',
  './_base_/ppyolov2_r50vd_dcn.yml',
  './_base_/optimizer_365e.yml',
  './_base_/ppyolov2_reader.yml',
]

修改配置文件PaddleDetection/configs/datasets/coco_detection.yml

metric: COCO
num_classes: 4  # 不包含背景类

TrainDataset:
  !COCODataSet
    image_dir: images
    anno_path: annotations/train.json
    dataset_dir: /home/aistudio/data
    data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']

EvalDataset:
  !COCODataSet
    image_dir: images
    anno_path: annotations/valid.json
    dataset_dir: /home/aistudio/data

TestDataset:
  !ImageFolder
    anno_path: /home/aistudio/data/annotations/valid.json

训练迭代了500epoch

使用单GPU通过如下命令一键式评估模型在COCO val2017数据集效果

# 使用PaddleDetection发布的权重
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams

# 使用训练保存的checkpoint
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo.yml -o weights=output/ppyolo/best_model
# 使用PaddleDetection发布的权重
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo_test.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams

# 使用训练保存的checkpoint
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/ppyolo/ppyolo_test.yml -o weights=output/ppyolo/best_model
# 推理单张图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439_640x640.jpg

# 推理目录下所有图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_dir=demo
# 推理单张图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439_640x640.jpg

# 推理目录下所有图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_dir=demo
# 推理单张图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_img=demo/000000014439_640x640.jpg

# 推理目录下所有图像
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --infer_dir=demo
# 导出模型,通过--exclude_nms参数裁剪掉模型中的NMS部分,默认存储于output/ppyolo目录
python tools/export_model.py -c configs/ppyolo/ppyolo.yml -o weights=https://paddlemodels.bj.bcebos.com/object_detection/ppyolo.pdparams --exclude_nms

# FP32 benchmark测试
CUDA_VISIBLE_DEVICES=0 python deploy/python/infer.py --model_dir=output/ppyolo --image_file=demo/000000014439_640x640.jpg --use_gpu=True --run_benchmark=True

# TensorRT FP16 benchmark测试
CUDA_VISIBLE_DEVICES=0 python deploy/python/infer.py --model_dir=output/ppyolo --image_file=demo/000000014439_640x640.jpg --use_gpu=True --run_benchmark=True --run_mode=trt_fp16

最后

以上就是强健薯片为你收集整理的PaddleDetection-PP-YOLOv2 模型的全部内容,希望文章能够帮你解决PaddleDetection-PP-YOLOv2 模型所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(76)

评论列表共有 0 条评论

立即
投稿
返回
顶部