From 04047b7f7d79b6e276d15df1ded71c8d0bfa7b7b Mon Sep 17 00:00:00 2001 From: sufang Date: Wed, 28 Aug 2024 15:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ai=E6=8F=92=E4=BB=B6=E6=9E=B6?= =?UTF-8?q?=E6=9E=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ .../photo-viewer-aiassistant-plugin.pro | 7 +++++++ photo-viewer-aiassistant-plugin/photoviewerplugin.cpp | 4 ++++ photo-viewer-aiassistant-plugin/photoviewerplugin.h | 2 ++ 4 files changed, 22 insertions(+) diff --git a/debian/changelog b/debian/changelog index fee36f3..6a4b68d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-photo-viewer (1.3.0.3-ok22.33) nile; urgency=medium + + * BUG号:无 + * 需求号:无 + * 其他改动说明:修改ai插件架构判断 + * 影响域:无 + + -- sufang Wed, 28 Aug 2024 15:22:54 +0800 + kylin-photo-viewer (1.3.0.3-ok22.32) nile; urgency=medium * BUG号:无 diff --git a/photo-viewer-aiassistant-plugin/photo-viewer-aiassistant-plugin.pro b/photo-viewer-aiassistant-plugin/photo-viewer-aiassistant-plugin.pro index ad13383..5d6f076 100644 --- a/photo-viewer-aiassistant-plugin/photo-viewer-aiassistant-plugin.pro +++ b/photo-viewer-aiassistant-plugin/photo-viewer-aiassistant-plugin.pro @@ -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 diff --git a/photo-viewer-aiassistant-plugin/photoviewerplugin.cpp b/photo-viewer-aiassistant-plugin/photoviewerplugin.cpp index 13194fc..61a9d81 100644 --- a/photo-viewer-aiassistant-plugin/photoviewerplugin.cpp +++ b/photo-viewer-aiassistant-plugin/photoviewerplugin.cpp @@ -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) diff --git a/photo-viewer-aiassistant-plugin/photoviewerplugin.h b/photo-viewer-aiassistant-plugin/photoviewerplugin.h index 33b3b41..e19aeaa 100644 --- a/photo-viewer-aiassistant-plugin/photoviewerplugin.h +++ b/photo-viewer-aiassistant-plugin/photoviewerplugin.h @@ -13,7 +13,9 @@ #include #include #include +#if !defined(__loongarch64) #include +#endif #include "kylinimagecodec.h" using namespace cv; using namespace std;