[ADD] pplcv area interpolation ()

* ADD: area interpolation for PPL.CV (cuda) backend

* ADD: "area" entry for unit testing
pull/2139/head
Carmine Ianni 2023-06-07 06:38:08 +02:00 committed by GitHub
parent 9db59240a4
commit 439f88b543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions
csrc/mmdeploy/operation/cuda
tests/test_csrc/preprocess

View File

@ -78,6 +78,8 @@ static auto Create(const string_view& interp) {
type = ppl::cv::InterpolationType::INTERPOLATION_LINEAR;
} else if (interp == "nearest") {
type = ppl::cv::InterpolationType::INTERPOLATION_NEAREST_POINT;
} else if (interp == "area") {
type = ppl::cv::InterpolationType::INTERPOLATION_AREA;
} else {
MMDEPLOY_ERROR("unsupported interpolation method: {}", interp);
throw_exception(eNotSupported);

View File

@ -156,7 +156,7 @@ TEST_CASE("resize transform: size", "[resize]") {
vector<cv::Mat> mats{bgr_mat, gray_mat, bgr_float_mat, gray_float_mat};
vector<string> interpolations{"bilinear", "nearest", "area", "bicubic", "lanczos"};
set<string> cuda_interpolations{"bilinear", "nearest"};
set<string> cuda_interpolations{"bilinear", "nearest", "area"};
constexpr const char* kHost = "cpu";
SECTION("tuple size with -1") {
for (auto& mat : mats) {