mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-30 20:40:22 +08:00
[FlyCV] optimize the integration of FlyCV (#492)
* [Backend] fix lite backend save model error * [Backend] fixed typos * [FlyCV] optimize the integration of FlyCV * [cmake] close some tests options * [cmake] close some test option * [FlyCV] remove un-need warnings * [FlyCV] remove un-need GetMat method * [FlyCV] optimize FlyCV codes * [cmake] remove un-need cmake function in examples/CMakelists * [cmake] support gflags for Android
This commit is contained in:
@@ -55,12 +55,12 @@ bool Resize::ImplByOpenCV(Mat* mat) {
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FLYCV
|
||||
bool Resize::ImplByFalconCV(Mat* mat) {
|
||||
bool Resize::ImplByFlyCV(Mat* mat) {
|
||||
if (mat->layout != Layout::HWC) {
|
||||
FDERROR << "Resize: The format of input is not HWC." << std::endl;
|
||||
return false;
|
||||
}
|
||||
fcv::Mat* im = mat->GetFalconCVMat();
|
||||
fcv::Mat* im = mat->GetFlyCVMat();
|
||||
int origin_w = im->width();
|
||||
int origin_h = im->height();
|
||||
|
||||
@@ -79,7 +79,7 @@ bool Resize::ImplByFalconCV(Mat* mat) {
|
||||
} else if (interp_ == 2) {
|
||||
interp_method = fcv::InterpolationType::INTER_CUBIC;
|
||||
} else {
|
||||
FDERROR << "LimitLong: Only support interp_ be 0/1/2 with FalconCV, but "
|
||||
FDERROR << "LimitLong: Only support interp_ be 0/1/2 with FlyCV, but "
|
||||
"now it's "
|
||||
<< interp_ << "." << std::endl;
|
||||
return false;
|
||||
@@ -99,7 +99,8 @@ bool Resize::ImplByFalconCV(Mat* mat) {
|
||||
mat->SetHeight(new_im.height());
|
||||
} else if (scale_w_ > 0 && scale_h_ > 0) {
|
||||
fcv::Mat new_im;
|
||||
fcv::resize(*im, new_im, fcv::Size(0, 0), scale_w_, scale_h_, interp_method);
|
||||
fcv::resize(*im, new_im, fcv::Size(0, 0), scale_w_, scale_h_,
|
||||
interp_method);
|
||||
mat->SetMat(new_im);
|
||||
mat->SetWidth(new_im.width());
|
||||
mat->SetHeight(new_im.height());
|
||||
@@ -122,5 +123,5 @@ bool Resize::Run(Mat* mat, int width, int height, float scale_w, float scale_h,
|
||||
return r(mat, lib);
|
||||
}
|
||||
|
||||
} // namespace vision
|
||||
} // namespace fastdeploy
|
||||
} // namespace vision
|
||||
} // namespace fastdeploy
|
||||
|
||||
Reference in New Issue
Block a user