mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-24 17:10:35 +08:00
fix conflict for ascend
This commit is contained in:
@@ -73,6 +73,7 @@ bool FastDeployModel::InitRuntimeWithSpecifiedBackend() {
|
|||||||
if (!IsSupported(valid_cann_backends, runtime_option.backend)) {
|
if (!IsSupported(valid_cann_backends, runtime_option.backend)) {
|
||||||
FDERROR << "The valid cann backends of model " << ModelName() << " are " << Str(valid_cann_backends) << ", " << runtime_option.backend << " is not supported." << std::endl;
|
FDERROR << "The valid cann backends of model " << ModelName() << " are " << Str(valid_cann_backends) << ", " << runtime_option.backend << " is not supported." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
} else if (use_xpu) {
|
} else if (use_xpu) {
|
||||||
if (!IsSupported(valid_xpu_backends, runtime_option.backend)) {
|
if (!IsSupported(valid_xpu_backends, runtime_option.backend)) {
|
||||||
FDERROR << "The valid xpu backends of model " << ModelName() << " are " << Str(valid_xpu_backends) << ", " << runtime_option.backend << " is not supported." << std::endl;
|
FDERROR << "The valid xpu backends of model " << ModelName() << " are " << Str(valid_xpu_backends) << ", " << runtime_option.backend << " is not supported." << std::endl;
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ class FASTDEPLOY_DECL FastDeployModel {
|
|||||||
bool CreateTimVXBackend();
|
bool CreateTimVXBackend();
|
||||||
bool CreateXPUBackend();
|
bool CreateXPUBackend();
|
||||||
bool CreateCANNBackend();
|
bool CreateCANNBackend();
|
||||||
|
|
||||||
std::shared_ptr<Runtime> runtime_;
|
std::shared_ptr<Runtime> runtime_;
|
||||||
|
bool runtime_initialized_ = false;
|
||||||
// whether to record inference time
|
// whether to record inference time
|
||||||
bool enable_record_time_of_runtime_ = false;
|
bool enable_record_time_of_runtime_ = false;
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ void OcrRecognizerResizeImage(FDMat* mat, float max_wh_ratio,
|
|||||||
void OcrRecognizerResizeImageOnAscend(FDMat* mat,
|
void OcrRecognizerResizeImageOnAscend(FDMat* mat,
|
||||||
const std::vector<int>& rec_image_shape) {
|
const std::vector<int>& rec_image_shape) {
|
||||||
|
|
||||||
|
int img_h, img_w;
|
||||||
img_h = rec_image_shape[1];
|
img_h = rec_image_shape[1];
|
||||||
img_w = rec_image_shape[2];
|
img_w = rec_image_shape[2];
|
||||||
|
|
||||||
|
|
||||||
if (mat->Width() >= img_w) {
|
if (mat->Width() >= img_w) {
|
||||||
Resize::Run(mat, img_w, img_h); // Reszie W to 320
|
Resize::Run(mat, img_w, img_h); // Reszie W to 320
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user