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.75k stars 2.88k forks source link

piddleDetection serving部署后client测试只返回图片中的一个检测结果 #7566

Closed vividzhang closed 3 weeks ago

vividzhang commented 1 year ago

问题确认 Search before asking

请提出你的问题 Please ask your question

问题:按照文档 deploy/serving/python/README.md 部署服务后,测试无报错,但是返回结果只有一个检测框,期待是返回图片上所有的检测框

1、环境信息 ubuntu18.04+python3.7 paddle-bfloat 0.1.7 paddle-serving-app 0.9.0 paddle-serving-client 0.9.0 paddle-serving-server-gpu 0.9.0.post112 paddlepaddle-gpu 2.4.0.post112

2、复现步骤

导出模型: python tools/export_model.py -c configs/ppyoloe/ppyoloe_plus_crn_l_80e_coco.yml --export_serving_model True -o weights=https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_l_80e_coco.pdparams

服务部署: python deploy/serving/python/web_service.py --model_dir output_inference/ppyoloe_plus_crn_l_80e_coco

服务测试: python deploy/serving/python/pipeline_http_client.py --image_file demo/000000014439.jpg

返回结果: {'err_no': 0, 'err_msg': '', 'key': ['image_0'], 'value': ["['0 0.9093732237815857 163.77105712890625 81.8911361694336 198.59385681152344 167.4462890625']"], 'tensors': []}

在线等,期待大佬回复🙏🏻

lyuwenyu commented 1 year ago

不用serving看下推理的检测结果 另外可以在web_service里看下postprocess里的结果和client的结果是不是一样

vividzhang commented 1 year ago

用 python tools/infer.py -c configs/ppyoloe/ppyoloe_plus_crn_l_80e_coco.yml --infer_img=demo/000000014439.jpg -o use_gpu=True weights=https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_l_80e_coco.pdparams 这条命令的话会把检测到的框都渲染再output的图片上,结果远不止一个检测框。 另外我打断点在postprocess入口时,已经是只有一个检测框了;跟着代码一行行进去时,发现是在 paddle_serving_server/pipeline/operator.py 1151-1154 行内,把多个检测框只取了第一个,不确定是不是bug image

gitmhg commented 1 year ago

用 python tools/infer.py -c configs/ppyoloe/ppyoloe_plus_crn_l_80e_coco.yml --infer_img=demo/000000014439.jpg -o use_gpu=True weights=https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_l_80e_coco.pdparams 这条命令的话会把检测到的框都渲染再output的图片上,结果远不止一个检测框。 另外我打断点在postprocess入口时,已经是只有一个检测框了;跟着代码一行行进去时,发现是在 paddle_serving_server/pipeline/operator.py 1151-1154 行内,把多个检测框只取了第一个,不确定是不是bug image

n你好,我也遇到相同的问题,推理模型效果很好,但是服务部署模型,只能检测到一个或者检测不到,请问您解决了吗

klwcc commented 1 year ago

用 python tools/infer.py -c configs/ppyoloe/ppyoloe_plus_crn_l_80e_coco.yml --infer_img=demo/000000014439.jpg -o use_gpu=True weights=https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_l_80e_coco.pdparams 这条命令的话会把检测到的框都渲染再output的图片上,结果远不止一个检测框。 另外我打断点在postprocess入口时,已经是只有一个检测框了;跟着代码一行行进去时,发现是在 paddle_serving_server/pipeline/operator.py 1151-1154 行内,把多个检测框只取了第一个,不确定是不是bug image

你好,我也遇到相同的问题,麻烦问一下您那边解决了吗?是源码Bug还是我们使用的方式不对啊

ufwtlsb commented 1 year ago

好像是pdserving的bug 去掉后面start end就可以了

klwcc commented 1 year ago

多谢大神🙏发自我的 iPad在 2023年3月15日,18:32,ufwtlsb @.***> 写道: 好像是pdserving的bug 去掉后面start end就可以了

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ixiami1314 commented 1 year ago

我是直接容器安装部署的,具体要在哪里改动啊。

hanzhy-code commented 1 year ago

好像是pdserving的bug 去掉后面start end就可以了

改了之后,出来好多重复的目标框

ixiami1314 commented 1 year ago

我咋去掉都不行。你那一行是咋改的啊发自我的手机-------- 原始邮件 --------发件人: hanzhy-code @.>日期: 2023年9月26日周二 晚上9:57收件人: PaddlePaddle/PaddleDetection @.>抄送: ixiami1314 @.>, Comment @.>主 题: Re: [PaddlePaddle/PaddleDetection] piddleDetection serving部署后client测试只返回图片中的一个检测结果 (Issue #7566)

好像是pdserving的bug 去掉后面start end就可以了

改了之后,出来好多重复的目标框

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

hanzhy-code commented 1 year ago

我咋去掉都不行。你那一行是咋改的啊发自我的手机-------- 原始邮件 --------发件人: hanzhy-code @.>日期: 2023年9月26日周二 晚上9:57收件人: PaddlePaddle/PaddleDetection @.>抄送: ixiami1314 @.>, Comment @.>主 题: Re: [PaddlePaddle/PaddleDetection] piddleDetection serving部署后client测试只返回图片中的一个检测结果 (Issue #7566) 好像是pdserving的bug 去掉后面start end就可以了 改了之后,出来好多重复的目标框 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

pip show package_name 查询paddle_serving_server包的位置 然后再按照上面的修改1154行

ixiami1314 commented 1 year ago

我找到这一行了,意思是在问这一行具体改成啥。

midped_data_dict[data_id] = midped_batch[start:end]

hanzhy-code @.***> 于2023年9月27日周三 09:14写道:

我咋去掉都不行。你那一行是咋改的啊发自我的手机-------- 原始邮件 --------发件人: hanzhy-code @.>日期: 2023年9月26日周二 晚上9:57收件人: PaddlePaddle/PaddleDetection @.>抄送: ixiami1314 @.>, Comment @.>主 题: Re: [PaddlePaddle/PaddleDetection] piddleDetection serving部署后client测试只返回图片中的一个检测结果 (Issue #7566 https://github.com/PaddlePaddle/PaddleDetection/issues/7566) 好像是pdserving的bug 去掉后面start end就可以了 改了之后,出来好多重复的目标框 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

pip show package_name 查询paddle_serving_server包的位置 然后再按照上面的修改1154行

— Reply to this email directly, view it on GitHub https://github.com/PaddlePaddle/PaddleDetection/issues/7566#issuecomment-1736519099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEVP57GDNBUC3UTALQ47J3X4N4ZFANCNFSM6AAAAAATKFT7OE . You are receiving this because you commented.Message ID: @.***>

-- 用实力说话

paddle-bot[bot] commented 3 weeks ago

Since this issue has not been updated for more than three months, it will be closed, if it is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于该问题超过三个月未更新,将会被关闭,若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。