mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-13 04:13:58 +08:00
[Bug Fix] Fixed for CI (#499)
* add paddle_trt in benchmark * update benchmark in device * update benchmark * update result doc * fixed for CI
This commit is contained in:
@@ -49,7 +49,7 @@ function(add_fastdeploy_executable FIELD CC_FILE)
|
|||||||
add_executable(${TEMP_TARGET_NAME} ${TEMP_TARGET_FILE})
|
add_executable(${TEMP_TARGET_NAME} ${TEMP_TARGET_FILE})
|
||||||
target_link_libraries(${TEMP_TARGET_NAME} PUBLIC fastdeploy)
|
target_link_libraries(${TEMP_TARGET_NAME} PUBLIC fastdeploy)
|
||||||
if(TARGET gflags)
|
if(TARGET gflags)
|
||||||
if(UNIX)
|
if(UNIX AND (NOT APPLE) AND (NOT ANDROID))
|
||||||
target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags pthread)
|
target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags pthread)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags)
|
target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags)
|
||||||
|
@@ -11,7 +11,7 @@ include_directories(${FASTDEPLOY_INCS})
|
|||||||
|
|
||||||
add_executable(infer_demo ${PROJECT_SOURCE_DIR}/infer.cc)
|
add_executable(infer_demo ${PROJECT_SOURCE_DIR}/infer.cc)
|
||||||
# 添加FastDeploy库依赖
|
# 添加FastDeploy库依赖
|
||||||
if(UNIX)
|
if(UNIX AND (NOT APPLE) AND (NOT ANDROID))
|
||||||
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags pthread)
|
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags pthread)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags)
|
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags)
|
||||||
|
2
examples/vision/headpose/fsanet/cpp/CMakeLists.txt
Normal file → Executable file
2
examples/vision/headpose/fsanet/cpp/CMakeLists.txt
Normal file → Executable file
@@ -11,7 +11,7 @@ include_directories(${FASTDEPLOY_INCS})
|
|||||||
|
|
||||||
add_executable(infer_demo ${PROJECT_SOURCE_DIR}/infer.cc)
|
add_executable(infer_demo ${PROJECT_SOURCE_DIR}/infer.cc)
|
||||||
# 添加FastDeploy库依赖
|
# 添加FastDeploy库依赖
|
||||||
if(UNIX)
|
if(UNIX AND (NOT APPLE) AND (NOT ANDROID))
|
||||||
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags pthread)
|
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags pthread)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags)
|
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS} gflags)
|
||||||
|
@@ -44,7 +44,7 @@ bool CreateRuntimeOption(fastdeploy::RuntimeOption* option) {
|
|||||||
} else if (FLAGS_backend == "trt" ||
|
} else if (FLAGS_backend == "trt" ||
|
||||||
FLAGS_backend == "paddle_trt") {
|
FLAGS_backend == "paddle_trt") {
|
||||||
option->UseTrtBackend();
|
option->UseTrtBackend();
|
||||||
option.SetTrtInputShape("images", {1, 3, 64, 64});
|
option->SetTrtInputShape("images", {1, 3, 64, 64});
|
||||||
if (FLAGS_backend == "paddle_trt") {
|
if (FLAGS_backend == "paddle_trt") {
|
||||||
option->EnablePaddleToTrt();
|
option->EnablePaddleToTrt();
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ bool CreateRuntimeOption(fastdeploy::RuntimeOption* option) {
|
|||||||
} else if (FLAGS_backend == "default") {
|
} else if (FLAGS_backend == "default") {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
std::cout << "While inference with GPU, only support default/ort/paddle/trt/paddle_trt now, " << FLAG_backend << " is not supported." << std::endl;
|
std::cout << "While inference with GPU, only support default/ort/paddle/trt/paddle_trt now, " << FLAGS_backend << " is not supported." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (FLAGS_device == "cpu") {
|
} else if (FLAGS_device == "cpu") {
|
||||||
@@ -67,7 +67,7 @@ bool CreateRuntimeOption(fastdeploy::RuntimeOption* option) {
|
|||||||
} else if (FLAGS_backend == "default") {
|
} else if (FLAGS_backend == "default") {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
std::cout << "While inference with CPU, only support default/ort/ov/paddle now, " << FLAG_backend << " is not supported." << std::endl;
|
std::cout << "While inference with CPU, only support default/ort/ov/paddle now, " << FLAGS_backend << " is not supported." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
3
fastdeploy/vision/matting/contrib/rvm.cc
Normal file → Executable file
3
fastdeploy/vision/matting/contrib/rvm.cc
Normal file → Executable file
@@ -138,7 +138,8 @@ bool RobustVideoMatting::Postprocess(
|
|||||||
|
|
||||||
result->Clear();
|
result->Clear();
|
||||||
result->contain_foreground = true;
|
result->contain_foreground = true;
|
||||||
result->shape = {static_cast<int64_t>(in_h), static_cast<int64_t>(in_w)};
|
// if contain_foreground == true, shape must set to (h, w, c)
|
||||||
|
result->shape = {static_cast<int64_t>(in_h), static_cast<int64_t>(in_w), 3};
|
||||||
int numel = in_h * in_w;
|
int numel = in_h * in_w;
|
||||||
int nbytes = numel * sizeof(float);
|
int nbytes = numel * sizeof(float);
|
||||||
result->Resize(numel);
|
result->Resize(numel);
|
||||||
|
Reference in New Issue
Block a user