mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Model] [Part 1] Refactor PaddleClas module (#508)
* Split PaddleClas Module refactor * Split PaddleClas Module refactor * fix bug
This commit is contained in:
@@ -16,11 +16,19 @@ import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from .c_lib_wrap import (ModelFormat, Backend, rknpu2,
|
||||
FDDataType, TensorInfo, Device,
|
||||
FDTensor, is_built_with_gpu, is_built_with_ort,
|
||||
ModelFormat, is_built_with_paddle, is_built_with_trt,
|
||||
get_default_cuda_directory, )
|
||||
from .c_lib_wrap import (
|
||||
ModelFormat,
|
||||
Backend,
|
||||
rknpu2,
|
||||
FDDataType,
|
||||
TensorInfo,
|
||||
Device,
|
||||
is_built_with_gpu,
|
||||
is_built_with_ort,
|
||||
ModelFormat,
|
||||
is_built_with_paddle,
|
||||
is_built_with_trt,
|
||||
get_default_cuda_directory, )
|
||||
|
||||
from .runtime import Runtime, RuntimeOption
|
||||
from .model import FastDeployModel
|
||||
|
@@ -49,28 +49,28 @@ setup_configs = dict()
|
||||
setup_configs["ENABLE_PADDLE_FRONTEND"] = os.getenv("ENABLE_PADDLE_FRONTEND",
|
||||
"ON")
|
||||
setup_configs["ENABLE_RKNPU2_BACKEND"] = os.getenv("ENABLE_RKNPU2_BACKEND",
|
||||
"OFF")
|
||||
"OFF")
|
||||
setup_configs["ENABLE_ORT_BACKEND"] = os.getenv("ENABLE_ORT_BACKEND", "OFF")
|
||||
setup_configs["ENABLE_OPENVINO_BACKEND"] = os.getenv("ENABLE_OPENVINO_BACKEND",
|
||||
"OFF")
|
||||
setup_configs["ENABLE_PADDLE_BACKEND"] = os.getenv("ENABLE_PADDLE_BACKEND",
|
||||
"OFF")
|
||||
setup_configs["ENABLE_POROS_BACKEND"] = os.getenv("ENABLE_POROS_BACKEND",
|
||||
"OFF")
|
||||
setup_configs["ENABLE_POROS_BACKEND"] = os.getenv("ENABLE_POROS_BACKEND", "OFF")
|
||||
setup_configs["ENABLE_TRT_BACKEND"] = os.getenv("ENABLE_TRT_BACKEND", "OFF")
|
||||
setup_configs["ENABLE_LITE_BACKEND"] = os.getenv("ENABLE_LITE_BACKEND", "OFF")
|
||||
setup_configs["ENABLE_VISION"] = os.getenv("ENABLE_VISION", "OFF")
|
||||
setup_configs["ENABLE_FLYCV"] = os.getenv("ENABLE_FLYCV", "OFF")
|
||||
setup_configs["ENABLE_TEXT"] = os.getenv("ENABLE_TEXT", "OFF")
|
||||
setup_configs["ENABLE_TRT_BACKEND"] = os.getenv("ENABLE_TRT_BACKEND", "OFF")
|
||||
setup_configs["WITH_GPU"] = os.getenv("WITH_GPU", "OFF")
|
||||
setup_configs["WITH_IPU"] = os.getenv("WITH_IPU", "OFF")
|
||||
setup_configs["BUILD_ON_JETSON"] = os.getenv("BUILD_ON_JETSON", "OFF")
|
||||
setup_configs["TRT_DIRECTORY"] = os.getenv("TRT_DIRECTORY", "UNDEFINED")
|
||||
setup_configs["CUDA_DIRECTORY"] = os.getenv("CUDA_DIRECTORY",
|
||||
"/usr/local/cuda")
|
||||
setup_configs["CUDA_DIRECTORY"] = os.getenv("CUDA_DIRECTORY", "/usr/local/cuda")
|
||||
setup_configs["LIBRARY_NAME"] = PACKAGE_NAME
|
||||
setup_configs["PY_LIBRARY_NAME"] = PACKAGE_NAME + "_main"
|
||||
setup_configs["OPENCV_DIRECTORY"] = os.getenv("OPENCV_DIRECTORY", "")
|
||||
setup_configs["ORT_DIRECTORY"] = os.getenv("ORT_DIRECTORY", "")
|
||||
|
||||
setup_configs["RKNN2_TARGET_SOC"] = os.getenv("RKNN2_TARGET_SOC", "")
|
||||
|
||||
if setup_configs["WITH_GPU"] == "ON" or setup_configs[
|
||||
@@ -99,8 +99,7 @@ extras_require = {}
|
||||
|
||||
# Default value is set to TRUE\1 to keep the settings same as the current ones.
|
||||
# However going forward the recomemded way to is to set this to False\0
|
||||
USE_MSVC_STATIC_RUNTIME = bool(
|
||||
os.getenv('USE_MSVC_STATIC_RUNTIME', '1') == '1')
|
||||
USE_MSVC_STATIC_RUNTIME = bool(os.getenv('USE_MSVC_STATIC_RUNTIME', '1') == '1')
|
||||
ONNX_NAMESPACE = os.getenv('ONNX_NAMESPACE', 'paddle2onnx')
|
||||
################################################################################
|
||||
# Version
|
||||
@@ -130,8 +129,7 @@ assert CMAKE, 'Could not find "cmake" executable!'
|
||||
@contextmanager
|
||||
def cd(path):
|
||||
if not os.path.isabs(path):
|
||||
raise RuntimeError('Can only cd to absolute path, got: {}'.format(
|
||||
path))
|
||||
raise RuntimeError('Can only cd to absolute path, got: {}'.format(path))
|
||||
orig_path = os.getcwd()
|
||||
os.chdir(path)
|
||||
try:
|
||||
|
Reference in New Issue
Block a user