Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
wangxinxin08 69cc99f9d1 | 2 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago | |
rbox_iou_op.cc | 2 years ago | |
rbox_iou_op.cu | 2 years ago | |
rbox_iou_op.h | 2 years ago | |
setup.py | 2 years ago | |
test.py | 2 years ago |
旋转框IOU计算OP是参考自定义外部算子 。
python3.7 setup.py install
按照如下方式使用
# 引入自定义op
from rbox_iou_ops import rbox_iou
paddle.set_device('gpu:0')
paddle.disable_static()
rbox1 = np.random.rand(13000, 5)
rbox2 = np.random.rand(7, 5)
pd_rbox1 = paddle.to_tensor(rbox1)
pd_rbox2 = paddle.to_tensor(rbox2)
iou = rbox_iou(pd_rbox1, pd_rbox2)
print('iou', iou)
单元测试test.py
文件中,通过对比python实现的结果和测试自定义op结果。
由于python计算细节与cpp计算细节略有区别,误差区间设置为0.02。
python3.7 test.py
提示rbox_iou OP compute right!
说明OP测试通过。
PaddleDetection
Python Jupyter Notebook Markdown C++ Java other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》