Skip to content

Commit

Permalink
只保留了detect
Browse files Browse the repository at this point in the history
  • Loading branch information
licongjunye committed Mar 16, 2024
1 parent 9171379 commit d4b5653
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 516 deletions.
23 changes: 1 addition & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
### AL ###
#Template for AL projects for Dynamics 365 Business Central
#launch.json folder
.vscode/
#Cache folder
.alcache/
#Symbols folder
.alpackages/
#Snapshots folder
.snapshots/
#Testing Output folder
.output/
#Extension App-file
*.app
#Rapid Application Development File
rad.json
#Translation Base-file
*.g.xlf
#License-file
*.flf
#Test results file
TestResults.xml
build
50 changes: 2 additions & 48 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,14 @@ int main(int argc, char* argv[])
{
YoloModel yolomodel;
string xmlName_Detect = "/home/hlc/ultralytics/runs/detect/v2/train8/weights/best.xml";
// string xmlName_Cls = "./yolov8/model/yolov8n-cls.xml";
// string xmlName_Seg = "./yolov8/model/yolov8n-seg.xml";
// string xmlName_Pose = "./yolov8/model/yolov8n-Pose.xml";
string device = "GPU";
bool initDetectflag = yolomodel.LoadDetectModel(xmlName_Detect, device);
// bool initClsflag = yolomodel.LoadClsModel(xmlName_Cls, device);
// bool initSegflag = yolomodel.LoadSegModel(xmlName_Seg, device);
// bool initPoseflag = yolomodel.LoadPoseModel(xmlName_Pose, device);

if (initDetectflag == true)
{
cout << "检测模型初始化成功" << endl;
}
// if (initClsflag == true)
// {
// cout << "分类模型初始化成功" << endl;
// }
// if (initSegflag == true)
// {
// cout << "分割模型初始化成功" << endl;
// }
// if (initPoseflag == true)
// {
// cout << "姿态模型初始化成功" << endl;
// }
// 读取图像
// Mat img_Detect = cv::imread("/home/hlc/code/model/pic/frame_1140.jpg");
// Mat img_Cls = img_Detect.clone();
// Mat img_Seg = img_Detect.clone();
// Mat img_Pose = img_Detect.clone();


VideoCapture cap(0); // 0 for the default camera
if (!cap.isOpened()) {
std::cerr << "Error: Cannot open the camera." << std::endl;
Expand Down Expand Up @@ -67,30 +45,6 @@ int main(int argc, char* argv[])
}



// // 分类推理
// Mat dst_cls;
// double cof_threshold_Cls = 0.25;
// double nms_area_threshold_Cls = 0.5;
// vector<Object> vecObj_cls = {};
// bool InferClsflag = yolomodel.YoloClsInfer(img_Cls, cof_threshold_Cls, nms_area_threshold_Cls, dst_cls, vecObj_cls);


// // 分割推理
// Mat dst_seg;
// double cof_threshold_Seg = 0.25;
// double nms_area_threshold_Seg = 0.5;
// vector<Object> vecObj_seg = {};
// bool InferSegflag = yolomodel.YoloSegInfer(img_Seg, cof_threshold_Seg, nms_area_threshold_Seg, dst_seg, vecObj_seg);

// // 姿态推理
// Mat dst_pose;
// double cof_threshold_Pose = 0.25;
// double nms_area_threshold_Pose = 0.5;
// vector<Object> vecObj_Pose = {};
// bool InferPoseflag = yolomodel.YoloPoseInfer(img_Pose, cof_threshold_Pose, nms_area_threshold_Pose, dst_pose, vecObj_Pose);


// waitKey(0);
destroyAllWindows();
return 0;
Expand Down
Loading

0 comments on commit d4b5653

Please sign in to comment.