!142 修改ai插件架构判断

Merge pull request !142 from 苏芳/openkylin/nile
This commit is contained in:
苏芳 2024-08-28 07:45:00 +00:00 committed by Gitee
commit 6c1aa4029e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 22 additions and 0 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kylin-photo-viewer (1.3.0.3-ok22.33) nile; urgency=medium
* BUG号
* 需求号:无
* 其他改动说明修改ai插件架构判断
* 影响域:无
-- sufang <sufang@kylinos.cn> Wed, 28 Aug 2024 15:22:54 +0800
kylin-photo-viewer (1.3.0.3-ok22.32) nile; urgency=medium
* BUG号

View File

@ -30,8 +30,15 @@ LIBS += -lopencv_core \
-lopencv_dnn \
#onnxruntime
contains(QMAKE_HOST.arch, x86_64){
INCLUDEPATH += /usr/local/include/onnxruntime
LIBS += -L/usr/local/lib -lonnxruntime
}
contains(QMAKE_HOST.arch, aarch64){
INCLUDEPATH += /usr/local/include/onnxruntime
LIBS += -L/usr/local/lib -lonnxruntime
}
INCLUDEPATH += /usr/include/kylin_image_codec/
#LIBS += -L/usr/lib -lkylinimagecodec

View File

@ -33,6 +33,7 @@ void PhotoViewerPlugin::matToTransparent()
qDebug() << "Please input RGB image.";
return;
}
#if !defined(__loongarch64)
// 调整图像大小为模型期望的尺寸
int inputWidth = 512;
int inputHeight = 512;
@ -85,6 +86,9 @@ void PhotoViewerPlugin::matToTransparent()
cv::resize(matte_np, matte_resized, cv::Size(m_origMattingMat.cols, m_origMattingMat.rows), 0, 0, cv::INTER_LINEAR);
// 将抠图结果中背景部分设置为透明色
matte_resized.convertTo(m_transparentMat, CV_8U, 255); // 将灰度图像转换为 8 位图像
#else
return;
#endif
}
QString PhotoViewerPlugin::startMatting(QString origImagePath, uint b, uint g, uint r, uint a)

View File

@ -13,7 +13,9 @@
#include <opencv4/opencv2/imgcodecs.hpp>
#include <opencv4/opencv2/imgproc.hpp>
#include <opencv2/opencv.hpp>
#if !defined(__loongarch64)
#include <onnxruntime/onnxruntime_cxx_api.h>
#endif
#include "kylinimagecodec.h"
using namespace cv;
using namespace std;