[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:
DefTruth
2022-11-04 09:19:03 +08:00
committed by GitHub
parent 5b1fecd668
commit a36d49a973
56 changed files with 670 additions and 487 deletions
@@ -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