张洋 пре 1 дан
родитељ
комит
db76a5a6ab

+ 1 - 0
DuiLib/DuiLib.vcxproj

@@ -178,6 +178,7 @@ copy $(SolutionDir)temp\link\$(Platform)\$(Configuration)\$(ProjectName)\DuiLib.
       <BaseAddress>0x11000000</BaseAddress>
       <ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
       <TargetMachine>MachineX86</TargetMachine>
+      <SubSystem>Console</SubSystem>
     </Link>
     <Bscmake>
       <SuppressStartupBanner>true</SuppressStartupBanner>

BIN
bin/Win32/Debug/zhipuzi_pos_windows/DuiLib.dll


BIN
bin/Win32/Debug/zhipuzi_pos_windows/image_features.db


res/3.jpg → bin/Win32/Release/zhipuzi_pos_windows/3.jpg


BIN
bin/Win32/Release/zhipuzi_pos_windows/DuiLib.dll


BIN
res/image_features.db


BIN
bin/Win32/Release/zhipuzi_pos_windows/libcrypto-1_1.dll


BIN
bin/Win32/Release/zhipuzi_pos_windows/libssl-1_1.dll


BIN
dll/debug/DuiLib.dll


BIN
dll/release/DuiLib.dll


+ 16 - 10
zhipuzi_pos_windows/ai/test.cpp

@@ -1,4 +1,6 @@
-#include "test.h"
+#include "../pch/pch.h"
+
+#include "test.h"
 
 #include <iostream>
 
@@ -17,20 +19,24 @@
 
 int AITest()
 {
-	
-
 	try
 	{
 		// 设置路径(可根据实际情况修改)
-		std::string modelPath = "E:\\code\\zhipuzi\\zhipuzi_pos_windows\\res\\ai\\best.onnx";           // YOLO2026模型路径
-		std::string classesPath = "E:\\code\\zhipuzi\\zhipuzi_pos_windows\\res\\ai\\cls.names";             // 类别文件路径
-		std::string galleryDir = "E:\\code\\zhipuzi\\zhipuzi_pos_windows\\res\\images";       // 图库目录路径
-		std::string searchImagePath = "E:\\code\\zhipuzi\\zhipuzi_pos_windows\\res\\3.jpg"; // 搜索图片路径
+		std::wstring wsExePath = CSystem::getExePath();
+		std::wstring wsProgramDir = CSystem::GetProgramDir();
+
+		std::filesystem::path mainDir = wsProgramDir;
+		std::string sMainDir = mainDir.string();
+
+		//用于测试的图片目录
+		std::string galleryDir = (mainDir.parent_path().parent_path().parent_path().parent_path() /"res"/"images").string();       // 图库目录路径
 
-		std::wstring folderPath = CSystem::GetProgramDir() + L"\\db\\image_features.db";
-		std::string databasePath = CLewaimaiString::UnicodeToUTF8(folderPath);
+		std::string modelPath = sMainDir + "/ai/best.onnx";           // YOLO2026模型路径
+		std::string classesPath = sMainDir + "/ai/cls.names";             // 类别文件路径
+		std::string searchImagePath = sMainDir + "/3.jpg"; // 搜索图片路径
 
-		std::filesystem::remove(folderPath);
+		std::string databasePath = sMainDir + "/image_features.db";     // SQLite数据库路径
+		std::filesystem::remove(databasePath);
 
 		std::cout << "=== YOLO2026图像检索系统 (SQLite-Vec版本) ===" << std::endl;
 		std::cout << "模型路径: " << modelPath << std::endl;

+ 1 - 2
zhipuzi_pos_windows/helper/CSystem.h

@@ -45,5 +45,4 @@ public:
 	static BOOL IsAppRunning();
 
 	static void RunHotKey(int mod, int key);
-};
-
+};

+ 1 - 1
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -23,7 +23,7 @@
     <ProjectGuid>{1D694BE0-D976-4F29-8997-3308ADFFF413}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>zhipuziposwindows</RootNamespace>
-    <WindowsTargetPlatformVersion>7</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
     <ProjectName>zhipuzi_pos_windows</ProjectName>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />