forked from PaddlePaddle/PaddleCustomDevice
-
Notifications
You must be signed in to change notification settings - Fork 1
PaddleX GCU Models Verification
EnflameGCU edited this page Dec 4, 2024
·
1 revision
当前支持evaluate和predict模式
参考燧原GCU飞桨安装教程配置环境。
paddlepaddle和paddle_custom_gcu版本:
python -m pip install paddlepaddle==3.0.0.dev20241202 -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
python -m pip install paddle_custom_gcu==3.0.0.dev20241203 -i https://www.paddlepaddle.org.cn/packages/nightly/gcu/- 在
PaddleX源码根目录下,创建output目录及对应的模型子目录${MODEL_NAME};
mkdir -p output && mkdir -p output/${MODEL_NAME} && mkdir -p output/${MODEL_NAME}/inference- 参考PaddleX模型列表(燧原 GCU)下载训练模型和推理模型;
- 下载训练模型,用于
evaluate,测试精度数据。训练模型存放路径:PaddleX/output/${MODEL_NAME}- 下载推理模型,用于
predict。推理模型解压后存放路径:PaddleX/output/${MODEL_NAME}/inference
- 参考PaddleX模型列表(燧原 GCU)中模型的说明下载对应数据集。如,存放在
PaddleX源码根目录下新建的dataset目录。
验证脚本:test_scripts.zip,解压至PaddleX根目录
执行脚本:test_obj_detection.sh
执行方法:运行以下命令
bash test_obj_detection.sh -n PP-YOLOE_plus-L -m evaluate -d gcu:0其中参数:
- -n 用于指定具体的模型,支持列表详见PaddleX模型列表(燧原 GCU)目标检测模块。当前为:
PP-YOLOE_plus-L/PP-YOLOE_plus-M/PP-YOLOE_plus-S/PP-YOLOE_plus-X/RT-DETR-H/RT-DETR-L/RT-DETR-R18/RT-DETR-R50/RT-DETR-X - -m 用于指定执行模式,支持
evaluate和predict,默认为evaluate - -d 用于指定设备,支持
gcu和cpu,默认为gcu:0
执行后得到类似如下结果(evaluate for PP-YOLOE_plus-L):
[12/03 16:51:37] ppdet.metrics.coco_utils INFO: Start evaluate...
Loading and preparing results...
DONE (t=8.87s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
DONE (t=53.99s).
Accumulating evaluation results...
DONE (t=13.15s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.528
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.700
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.578
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.352
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.575
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.690
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.393
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.662
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.722
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.560
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.779
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.869
[12/03 16:52:56] ppdet.engine.callbacks INFO: Total sample number: 5000, average FPS: 21.565695187123872
I1203 16:52:56.371270 2263019 runtime.cc:124] Backend GCU finalize device:0
I1203 16:52:56.371306 2263019 runtime.cc:98] Backend GCU Finalize另外说明:通过paddlex执行PP-YOLOE_plus-S,因当前repo_apis内配置文件差异需额外指定Evaluate.basic_config_path(已在脚本中体现)。
执行脚本:test_ocr_det.sh
执行方法:运行以下命令
bash test_ocr_det.sh -n PP-OCRv4_mobile_det -m evaluate -d gcu:0其中参数:
- -n 用于指定具体的模型,支持列表详见PaddleX模型列表(燧原 GCU)文本检测模块。当前为:
PP-OCRv4_mobile_det/PP-OCRv4_server_det - -m 用于指定执行模式,支持
evaluate和predict,默认为evaluate - -d 用于指定设备,支持
gcu和cpu,默认为gcu:0
执行后得到类似如下结果(evaluate for PP-OCRv4_mobile_det):
[2024/12/04 11:38:55] ppocr INFO: metric eval ***************
[2024/12/04 11:38:55] ppocr INFO: precision:0.7464859437751004
[2024/12/04 11:38:55] ppocr INFO: recall:0.7159364467982667
[2024/12/04 11:38:55] ppocr INFO: hmean:0.7308921110838044
[2024/12/04 11:38:55] ppocr INFO: fps:11.651153135273901
I1204 11:38:55.943527 3012464 runtime.cc:124] Backend GCU finalize device:0
I1204 11:38:55.943547 3012464 runtime.cc:98] Backend GCU Finalize另外说明:以上验证数据使用的OCR数据集及权重由PaddleX开发同学线下提供
执行脚本:test_ocr_rec.sh
执行方法:运行以下命令
bash test_ocr_rec.sh -n PP-OCRv4_mobile_rec -m evaluate -d gcu:0其中参数:
- -n 用于指定具体的模型,支持列表详见PaddleX模型列表(燧原 GCU)文本识别模块。当前为:
PP-OCRv4_mobile_rec/PP-OCRv4_server_rec - -m 用于指定执行模式,支持
evaluate和predict,默认为evaluate - -d 用于指定设备,支持
gcu和cpu,默认为gcu:0
执行后得到类似如下结果(evaluate for PP-OCRv4_mobile_rec):
[2024/12/04 11:42:16] ppocr INFO: metric eval ***************
[2024/12/04 11:42:16] ppocr INFO: acc:0.6374578688615412
[2024/12/04 11:42:16] ppocr INFO: norm_edit_dis:0.8479163495534447
[2024/12/04 11:42:16] ppocr INFO: fps:118.35281378091548
I1204 11:42:16.038471 3016791 runtime.cc:124] Backend GCU finalize device:0
I1204 11:42:16.038492 3016791 runtime.cc:98] Backend GCU Finalize另外说明:以上验证数据使用的OCR数据集及权重由PaddleX开发同学线下提供