mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 17:17:14 +08:00

* Add falcon cmake * Update CMakeLists.txt * Add implementation for more preprocessors * Add more implementation * Add more implementations by flycv * Fix some name * fix some bug * ready to test * add fuse * fix fuse problem * add debug code * add debug * [Android] integrate flycv to Android (#459) * [Android] integrate flycv into Andorid * Falconcv (#27) * [Bug Fix ]Update ppseg visualize python api && demo (#454) Update ppseg visualize python api && demo * [Model] update pptracking letterboxresize and add some comment (#438) * add override mark * delete some * recovery * recovery * add tracking * add tracking py_bind and example * add pptracking * add pptracking * iomanip head file * add opencv_video lib * add python libs package Signed-off-by: ChaoII <849453582@qq.com> * complete comments Signed-off-by: ChaoII <849453582@qq.com> * add jdeTracker_ member variable Signed-off-by: ChaoII <849453582@qq.com> * add 'FASTDEPLOY_DECL' macro Signed-off-by: ChaoII <849453582@qq.com> * remove kwargs params Signed-off-by: ChaoII <849453582@qq.com> * [Doc]update pptracking docs * delete 'ENABLE_PADDLE_FRONTEND' switch * add pptracking unit test * update pptracking unit test Signed-off-by: ChaoII <849453582@qq.com> * modify test video file path and remove trt test * update unit test model url * remove 'FASTDEPLOY_DECL' macro Signed-off-by: ChaoII <849453582@qq.com> * fix build python packages about pptracking on win32 Signed-off-by: ChaoII <849453582@qq.com> * update comment Signed-off-by: ChaoII <849453582@qq.com> * add pptracking model explain Signed-off-by: ChaoII <849453582@qq.com> Signed-off-by: ChaoII <849453582@qq.com> Co-authored-by: Jason <jiangjiajun@baidu.com> Signed-off-by: ChaoII <849453582@qq.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: ChaoII <849453582@qq.com> Co-authored-by: Jason <jiangjiajun@baidu.com> * [cmake] optimize examples CMakeLists.txt Signed-off-by: ChaoII <849453582@qq.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: ChaoII <849453582@qq.com> Co-authored-by: Jason <jiangjiajun@baidu.com> * remove debug log * remove function * remove function Signed-off-by: ChaoII <849453582@qq.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: ChaoII <849453582@qq.com>
66 lines
2.2 KiB
C++
66 lines
2.2 KiB
C++
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include <array>
|
|
#include <vector>
|
|
#include "fastdeploy/vision.h"
|
|
#include "glog/logging.h"
|
|
#include "gtest/gtest.h"
|
|
#include "gtest_utils.h"
|
|
|
|
namespace fastdeploy {
|
|
|
|
#ifdef ENABLE_FLYCV
|
|
TEST(fastdeploy, flycv_norm_and_perm0) {
|
|
CheckShape check_shape;
|
|
CheckData check_data;
|
|
CheckType check_type;
|
|
|
|
cv::Mat mat(64, 64, CV_8UC3);
|
|
cv::randu(mat, cv::Scalar::all(0), cv::Scalar::all(255));
|
|
cv::Mat mat1 = mat.clone();
|
|
cv::Mat mat2 = mat.clone();
|
|
|
|
std::vector<float> mean({0.25, 0.35, 0.45});
|
|
std::vector<float> std({0.33, 0.22, 0.54});
|
|
std::vector<float> min;
|
|
std::vector<float> max;
|
|
|
|
vision::Mat mat_opencv(mat);
|
|
vision::Mat mat_opencv1(mat);
|
|
vision::Mat mat_flycv(mat1);
|
|
|
|
vision::Normalize::Run(&mat_opencv, mean, std, true, min, max, vision::ProcLib::OPENCV);
|
|
vision::HWC2CHW::Run(&mat_opencv, vision::ProcLib::OPENCV);
|
|
vision::NormalizeAndPermute::Run(&mat_opencv1, mean, std, true, min, max, vision::ProcLib::OPENCV);
|
|
|
|
vision::NormalizeAndPermute::Run(&mat_flycv, mean, std, true, min, max, vision::ProcLib::FLYCV);
|
|
|
|
FDTensor opencv;
|
|
FDTensor opencv1;
|
|
FDTensor flycv;
|
|
|
|
mat_opencv.ShareWithTensor(&opencv);
|
|
mat_opencv1.ShareWithTensor(&opencv1);
|
|
mat_flycv.ShareWithTensor(&flycv);
|
|
|
|
check_shape(opencv.shape, flycv.shape);
|
|
check_data(reinterpret_cast<const float*>(opencv.Data()), reinterpret_cast<const float*>(flycv.Data()), opencv.Numel());
|
|
check_data(reinterpret_cast<const float*>(opencv1.Data()), reinterpret_cast<const float*>(flycv.Data()), opencv1.Numel());
|
|
check_type(opencv.dtype, flycv.dtype);
|
|
}
|
|
#endif
|
|
|
|
} // namespace fastdeploy
|