PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.65k stars 2.87k forks source link

BlazeFace C++推理结果错误 #5862

Closed sl3120 closed 2 years ago

sl3120 commented 2 years ago

使用PaddleDetection\deploy\cpp编译的main推理blazeface_fpn_ssh_1000e模型得到的结果不正确,推理blazeface_1000e模型也是类似的结果,但是推理ppyoloe_crn_l_300e_coco是正确的,想知道是哪里出错了。

main --model_dir blazeface_fpn_ssh_1000e --image_file 000000014439.jpg
total images = 1, batch_size = 1, total steps = 1
class=0 confidence=0.9898 rect=**[337233 49164 346802 56248]**
class=0 confidence=0.9256 rect=**[378411 47234 384273 51903]**
class=0 confidence=0.6018 rect=**[284291 40201 291305 47762]**
000000014439.jpg The number of detected box: 3
Visualized output saved as output\000000014439.jpg
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0429 10:36:48.787504 13220 main.cc:76] ----------------------- Config info -----------------------
I0429 10:36:48.790469 13220 main.cc:77] runtime_device: CPU
I0429 10:36:48.790469 13220 main.cc:78] ir_optim: True
I0429 10:36:48.791489 13220 main.cc:80] enable_memory_optim: True
I0429 10:36:48.792490 13220 main.cc:89] enable_tensorrt: False
I0429 10:36:48.795504 13220 main.cc:91] precision: fp32
I0429 10:36:48.798543 13220 main.cc:94] enable_mkldnn: False
I0429 10:36:48.799546 13220 main.cc:95] cpu_math_library_num_threads: 1
I0429 10:36:48.800128 13220 main.cc:96] ----------------------- Data info -----------------------
I0429 10:36:48.801134 13220 main.cc:97] batch_size: 1
I0429 10:36:48.802132 13220 main.cc:98] input_shape: dynamic shape
I0429 10:36:48.802132 13220 main.cc:100] ----------------------- Model info -----------------------
I0429 10:36:48.803131 13220 main.cc:102] model_name: blazeface_fpn_ssh_1000e
I0429 10:36:48.805133 13220 main.cc:104] ----------------------- Perf info ------------------------
I0429 10:36:48.806133 13220 main.cc:105] Total number of predicted data: 1 and total time spent(ms): 587
I0429 10:36:48.807132 13220 main.cc:108] preproce_time(ms): 9.1089, inference_time(ms): 578.431, postprocess_time(ms): 0.1867

附上导出模型的信息:

python tools/export_model.py -c configs/face_detection/blazeface_fpn_ssh_1000e.yml --output_dir=output_inference -o weights=https://paddledet.bj.bcebos.com/models/blazeface_fpn_ssh_1000e.pdparams
Warning: import ppdet from source directory without installing, run 'python setup.py install' to install ppdet firstly
[04/29 10:35:28] ppdet.utils.download INFO: Downloading blazeface_fpn_ssh_1000e.pdparams from https://paddledet.bj.bcebos.com/models/blazeface_fpn_ssh_1000e.pdparams
  7%|███████▎                                                                                                      | 67/1001 [00:00<00:01, 585. 19%|█████████████████████▏                                                                                       | 195/1001 [00: 32%|██████████████████████████████████▊                                                                         | 3 45%|████████████████████████████████████████████████▋                                                 56%|████████████████████████████████████████████████████████████▉                         69%|█████████████████████████████████████████████████████████████████████████ 78%|██████████████████ ███████████████████████████████████████████████████████100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1001/1001 [00:01<00:00, 774.53KB/s]
[04/29 10:35:30] ppdet.utils.checkpoint INFO: Finish loading model weights: C:\Users\DL/.cache/paddle/weights\blazeface_fpn_ssh_1000e.pdparams
[04/29 10:35:30] ppdet.data.source.category WARNING: anno_file 'None' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categories will be used by metric_type.
[04/29 10:35:30] ppdet.engine INFO: Export inference config file to output_inference\blazeface_fpn_ssh_1000e\infer_cfg.yml
W0429 10:35:38.196111  4912 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.3, Runtime API Version: 10.2
W0429 10:35:38.196111  4912 device_context.cc:465] device: 0, cuDNN Version: 7.6.
[04/29 10:35:41] ppdet.engine INFO: Export model and saved in output_inference\blazeface_fpn_ssh_1000e

环境/Environment

Paddle:2.2.2;PaddleDetection:2.4 Windows 11 Python: 3.8.5 CUDA:10.2,CUDNN:7.6.5.

sl3120 commented 2 years ago

其他:VS2017 + opencv4.1.0

qingqing01 commented 2 years ago

@sl3120 感谢反馈,我们排查下。 @ghostxsl 请看下这个问题吧。