Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radial n tangential undistort #346

Merged
merged 24 commits into from
May 23, 2023

Conversation

ZS-YANG
Copy link
Contributor

@ZS-YANG ZS-YANG commented May 20, 2023

添加c++畸变校正算子

测试结果

仿真图像

  • 分辨率: 200x200

硬件信息

  • CPU:2核
  • AI加速卡:v100
  • 总显存:16GB
  • 总内存:16 GB
  • 总硬盘:100 GB
  • 环境配置Python:3.9.16

框架信息

  • 框架版本:PaddlePaddle 2.4.1
    测试三次取平均值,程序的运行时间分别为
原始python(Tensor device=cpu 原始python(Tensor device=gpu) cpu算子 gpu算子
0.0332489013671875 s 0.024889707565307617 s 0.015497446060180600 s 0.000442902247111002 s

paddle.allclose测试全部通过

#include <paddle/extension.h>

#include <vector>
// #define PADDLE_WITH_CUDA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要的代码需要删除,下同

void cv_undistort_cpu_kernel(const data_t *xy_coords,
const data_t *distortion_coeffs, data_t *xy_undist,
float eps, int max_iterations, int input_numel) {
// 迭代过程中的数据
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释写成英文,下同

}
}

PD_BUILD_OP(cv_undistfun)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

算子名称仍然用radial_n_tangential_undistort吧,后续会替换掉paddle原生算子实现的版本


if paddle.device.is_compiled_with_cuda():
setup(
name='my_undist',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的模块名称使用undistort

@will-jl944
Copy link
Collaborator

0.028573989868164062 s

这里的gpu测试结果是不是写成cpu的了。

@ZS-YANG ZS-YANG requested a review from will-jl944 May 22, 2023 06:06
Copy link
Collaborator

@will-jl944 will-jl944 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@will-jl944 will-jl944 merged commit c4cec37 into PaddlePaddle:develop May 23, 2023
3 checks passed
@paddle-bot paddle-bot bot added the contributor External Developers label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External Developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants