|
|
@@ -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;
|