Skip to content

Commit

Permalink
* fix a bug in csrc/mmdeploy/preprocess/transform/normalize.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Qingrenn committed Dec 24, 2022
1 parent 7bcac39 commit e6a21d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csrc/mmdeploy/preprocess/transform/normalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ class Normalize : public Transform {
Tensor dst;
if (to_float_) {
OUTCOME_TRY(normalize_.Apply(tensor, dst));
data[key] = std::move(dst);
} 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);
data[key] = std::move(dst);
}
data[key] = std::move(dst);

for (auto& v : mean_) {
data["img_norm_cfg"]["mean"].push_back(v);
Expand Down

0 comments on commit e6a21d3

Please sign in to comment.