fix normalization to_rgb option (#1771)

This commit is contained in:
SineYuan 2023-02-21 17:08:34 +08:00 committed by GitHub
parent 4bb8920b61
commit c941045156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,8 +102,8 @@ class Normalize : public Transform {
} else if (to_rgb_) {
auto src_mat = to_mat(tensor, PixelFormat::kBGR);
Mat dst_mat;
OUTCOME_TRY(cvt_color_.Apply(src_mat, dst_mat, PixelFormat::kBGR));
dst = to_tensor(src_mat);
OUTCOME_TRY(cvt_color_.Apply(src_mat, dst_mat, PixelFormat::kRGB));
dst = to_tensor(dst_mat);
}
data[key] = std::move(dst);