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.86k stars 2.9k forks source link

RT-DETR中的where #8548

Open sdreamforchen opened 1 year ago

sdreamforchen commented 1 year ago

问题确认 Search before asking

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

https://github.com/PaddlePaddle/PaddleDetection/blob/a3e9c925074dd91f98516c2bac057d190af9d7aa/ppdet/modeling/transformers/rtdetr_transformer.py#L508 以及https://github.com/PaddlePaddle/PaddleDetection/blob/a3e9c925074dd91f98516c2bac057d190af9d7aa/ppdet/modeling/transformers/rtdetr_transformer.py#L524C16-L524C16 您好,我自己单独把这个_generate_anchors写了一个python跑了一下,valid_mask恒为true: 1 onnx导出为false 2 这两个where是否有必要哇。 应该是我理解错了。 麻烦解答一下,谢谢!!!

复现环境 Environment

develop分支

Bug描述确认 Bug description confirmation

是否愿意提交PR? Are you willing to submit a PR?

lyuwenyu commented 1 year ago

其实他是为了保证生成的anchors是个合格的bbox 在看前面生成的时候有些超参数控制的 不排除在某些条件下生成的box有问题 所以才有这个逻辑 https://github.com/PaddlePaddle/PaddleDetection/blob/a3e9c925074dd91f98516c2bac057d190af9d7aa/ppdet/modeling/transformers/rtdetr_transformer.py#L505-L506