[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:
WJJ1995
2022-11-04 15:49:28 +08:00
committed by GitHub
parent 40d2f395ff
commit 61634caf28
5 changed files with 8 additions and 7 deletions

View File

@@ -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)

View 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)

2
examples/vision/headpose/fsanet/cpp/CMakeLists.txt Normal file → Executable file
View 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)

View File

@@ -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
View 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);