fix tracer (#1107)

This commit is contained in:
Chen Xin 2022-09-27 15:24:57 +08:00 committed by GitHub
parent 7da5c1408e
commit 0720ed8404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,14 +25,14 @@ void Tracer::PrepareImage(const std::string &color_type, bool to_float32, Tensor
void Tracer::Resize(const std::string &mode, const std::vector<int> &size, DataType dtype) {
trans_.push_back(ResizeParam{dtype, size, mode});
state_.shape[1] = size[0];
state_.shape[2] = size[2];
state_.shape[2] = size[1];
}
void Tracer::Pad(float pad_val, const std::vector<int> &tlbr, const std::vector<int> &size,
DataType dtype) {
trans_.push_back(PadParam{dtype, pad_val, tlbr, size});
state_.shape[1] = size[0];
state_.shape[2] = size[2];
state_.shape[2] = size[1];
}
void Tracer::Normalize(const std::vector<float> &mean, const std::vector<float> &std, bool to_rgb,
@ -55,7 +55,7 @@ void Tracer::CenterCrop(const std::vector<int> &tlbr, const std::vector<int> &si
DataType dtype) {
trans_.push_back(CropParam{state_.dtype, tlbr, size});
state_.shape[1] = size[0];
state_.shape[2] = size[2];
state_.shape[2] = size[1];
}
void Tracer::DefaultFormatBundle(bool to_float, DataType dtype) {