-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Model] Integrate FlyCV image processing library (#375)
* 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>
- Loading branch information
1 parent
c76992c
commit bb00e07
Showing
68 changed files
with
2,571 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# 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(ExternalProject) | ||
|
||
set(FLYCV_PROJECT "extern_flycv") | ||
set(FLYCV_PREFIX_DIR ${THIRD_PARTY_PATH}/flycv) | ||
set(FLYCV_SOURCE_DIR | ||
${THIRD_PARTY_PATH}/flycv/src/${FLYCV_PROJECT}) | ||
set(FLYCV_INSTALL_DIR ${THIRD_PARTY_PATH}/install/flycv) | ||
set(FLYCV_INC_DIR | ||
"${FLYCV_INSTALL_DIR}/include" | ||
CACHE PATH "flycv include directory." FORCE) | ||
if(ANDROID) | ||
set(FLYCV_LIB_DIR | ||
"${FLYCV_INSTALL_DIR}/lib/${ANDROID_ABI}" | ||
CACHE PATH "flycv lib directory." FORCE) | ||
else() | ||
set(FLYCV_LIB_DIR | ||
"${FLYCV_INSTALL_DIR}/lib/" | ||
CACHE PATH "flycv lib directory." FORCE) | ||
endif() | ||
set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH}" | ||
"${FLYCV_LIB_DIR}") | ||
|
||
include_directories(${FLYCV_INC_DIR}) | ||
|
||
# ABI check | ||
if(ANDROID) | ||
if((NOT ANDROID_ABI MATCHES "armeabi-v7a") AND (NOT ANDROID_ABI MATCHES "arm64-v8a")) | ||
message(FATAL_ERROR "FastDeploy with FlyCV only support armeabi-v7a, arm64-v8a now.") | ||
endif() | ||
if(NOT ANDROID_TOOLCHAIN MATCHES "clang") | ||
message(FATAL_ERROR "Currently, only support clang toolchain while cross compiling FastDeploy for Android with FlyCV, but found ${ANDROID_TOOLCHAIN}.") | ||
endif() | ||
endif() | ||
|
||
if(WIN32) | ||
set(FLYCV_COMPILE_LIB | ||
"${FLYCV_INSTALL_DIR}/lib/flycv.lib" | ||
CACHE FILEPATH "flycv compile library." FORCE) | ||
elseif(APPLE) | ||
set(FLYCV_COMPILE_LIB | ||
"${FLYCV_INSTALL_DIR}/lib/libflycv.dylib" | ||
CACHE FILEPATH "flycv compile library." FORCE) | ||
elseif(ANDROID) | ||
set(FLYCV_COMPILE_LIB | ||
"${FLYCV_INSTALL_DIR}/lib/${ANDROID_ABI}/libflycv_shared.so" | ||
CACHE FILEPATH "flycv compile library." FORCE) | ||
else() | ||
set(FLYCV_COMPILE_LIB | ||
"${FLYCV_INSTALL_DIR}/lib/libflycv_shared.so" | ||
CACHE FILEPATH "flycv compile library." FORCE) | ||
endif(WIN32) | ||
|
||
set(FLYCV_URL_BASE "https://bj.bcebos.com/fastdeploy/third_libs/") | ||
set(FLYCV_VERSION "1.0.1025") | ||
if(WIN32) | ||
message(FATAL_ERROR "FlyCV is not supported on Windows now.") | ||
set(FLYCV_FILE "flycv-win-x64-${FLYCV_VERSION}.zip") | ||
elseif(APPLE) | ||
message(FATAL_ERROR "FlyCV is not supported on Mac OSX now.") | ||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64") | ||
set(FLYCV_FILE "flycv-osx-arm64-${FLYCV_VERSION}.tgz") | ||
else() | ||
set(FLYCV_FILE "flycv-osx-x86_64-${FLYCV_VERSION}.tgz") | ||
endif() | ||
elseif(ANDROID) | ||
set(FLYCV_FILE "flycv-android-${FLYCV_VERSION}.tgz") | ||
else() | ||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") | ||
set(FLYCV_FILE "flycv-linux-aarch64-${FLYCV_VERSION}.tgz") | ||
else() | ||
message(FATAL_ERROR "FlyCV is not supported on Linux x64 now.") | ||
set(FLYCV_FILE "flycv-linux-x64-${FLYCV_VERSION}.tgz") | ||
endif() | ||
endif() | ||
set(FLYCV_URL "${FLYCV_URL_BASE}${FLYCV_FILE}") | ||
|
||
if(ANDROID) | ||
ExternalProject_Add( | ||
${FLYCV_PROJECT} | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
URL ${FLYCV_URL} | ||
PREFIX ${FLYCV_PREFIX_DIR} | ||
DOWNLOAD_NO_PROGRESS 1 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
UPDATE_COMMAND "" | ||
INSTALL_COMMAND | ||
${CMAKE_COMMAND} -E remove_directory ${FLYCV_INSTALL_DIR} && | ||
${CMAKE_COMMAND} -E make_directory ${FLYCV_INSTALL_DIR} && | ||
${CMAKE_COMMAND} -E make_directory ${FLYCV_INSTALL_DIR}/lib && | ||
${CMAKE_COMMAND} -E rename ${FLYCV_SOURCE_DIR}/lib/${ANDROID_ABI} | ||
${FLYCV_LIB_DIR} && ${CMAKE_COMMAND} -E copy_directory | ||
${FLYCV_SOURCE_DIR}/include ${FLYCV_INC_DIR} | ||
BUILD_BYPRODUCTS ${FLYCV_COMPILE_LIB}) | ||
else() | ||
ExternalProject_Add( | ||
${FLYCV_PROJECT} | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
URL ${FLYCV_URL} | ||
PREFIX ${FLYCV_PREFIX_DIR} | ||
DOWNLOAD_NO_PROGRESS 1 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
UPDATE_COMMAND "" | ||
INSTALL_COMMAND | ||
${CMAKE_COMMAND} -E remove_directory ${FLYCV_INSTALL_DIR} && | ||
${CMAKE_COMMAND} -E make_directory ${FLYCV_INSTALL_DIR} && | ||
${CMAKE_COMMAND} -E rename ${FLYCV_SOURCE_DIR}/lib/ | ||
${FLYCV_LIB_DIR} && ${CMAKE_COMMAND} -E copy_directory | ||
${FLYCV_SOURCE_DIR}/include ${FLYCV_INC_DIR} | ||
BUILD_BYPRODUCTS ${FLYCV_COMPILE_LIB}) | ||
endif() | ||
|
||
add_library(external_flycv STATIC IMPORTED GLOBAL) | ||
set_property(TARGET external_flycv PROPERTY IMPORTED_LOCATION | ||
${FLYCV_COMPILE_LIB}) | ||
add_dependencies(external_flycv ${FLYCV_PROJECT}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.