[Model] Add Paddle3D CenterPoint model (#2078)

* add centerpoint

* update for review comments
This commit is contained in:
zengshao0622
2023-07-03 13:39:16 +08:00
committed by GitHub
parent b2426aefa9
commit 79a3587339
18 changed files with 761 additions and 29 deletions
@@ -0,0 +1,14 @@
PROJECT(infer_demo C CXX)
CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
# 指定下载解压后的fastdeploy库路径
option(FASTDEPLOY_INSTALL_DIR "Path of downloaded fastdeploy sdk.")
include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake)
# 添加FastDeploy依赖头文件
include_directories(${FASTDEPLOY_INCS})
add_executable(infer_demo ${PROJECT_SOURCE_DIR}/infer.cc)
# 添加FastDeploy库依赖
target_link_libraries(infer_demo ${FASTDEPLOY_LIBS})
@@ -0,0 +1,38 @@
// 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 "fastdeploy/vision.h"
int main(int argc, char* argv[]) {
fastdeploy::RuntimeOption option;
option.UseGpu();
option.UsePaddleBackend();
std::string model_file = argv[1];
std::string params_file = argv[2];
std::string test_point = argv[3];
auto model = fastdeploy::vision::perception::Centerpoint(
model_file, params_file, "test", option, fastdeploy::ModelFormat::PADDLE);
assert(model.Initialized());
fastdeploy::vision::PerceptionResult res;
if (!model.Predict(test_point, &res)) {
std::cerr << "Failed to predict." << std::endl;
return 1;
}
std::cout << "predict result:" << res.Str() << std::endl;
return 0;
}