File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 55 "name" : " Debug Yolo Model" ,
66 "type" : " cppdbg" ,
77 "request" : " launch" ,
8- "program" : " ${workspaceFolder}/build/devel/lib/yolo_onnx_ros/test_yolo_onnx_ros" , // Path to the executable
9- "args" : [], // Add any command-line arguments for your program here
8+ "program" : " /home/amigo/ros/noetic/system/devel/lib/yolo_onnx_ros/test_yolo_onnx_ros" , // Path to the executable
9+ "args" : [
10+ " /home/amigo/ros/noetic/repos/github.com/tue-robotics/yolo_onnx_ros/data/yolo11m.onnx" ,
11+ " /home/amigo/Documents/repos/hero_sam.bak/pipeline/build/images"
12+ ], // Add any command-line arguments for your program here
1013 "stopAtEntry" : false ,
1114 "cwd" : " ${workspaceFolder}/build" , // Set the working directory
1215 "environment" : [],
1922 "ignoreFailures" : true
2023 }
2124 ],
22- "preLaunchTask" : " build-yolo-project" // Ensure the project is built before debugging
25+ // "preLaunchTask": "build-yolo-project" // Ensure the project is built before debugging
2326 },
2427 {
2528 "name" : " Debug Yolo Test" ,
2629 "type" : " cppdbg" ,
2730 "request" : " launch" ,
28- "program" : " ${workspaceFolder}/build/Yolov8OnnxRuntimeCPPInference_test " , // Path to the executable
31+ "program" : " /home/amigo/ros/noetic/system/devel/lib/yolo_onnx_ros/yolo_test " , // Path to the executable
2932 "args" : [], // Add any command-line arguments for your program here
3033 "stopAtEntry" : false ,
3134 "cwd" : " ${workspaceFolder}/build" , // Set the working directory
3942 "ignoreFailures" : true
4043 }
4144 ],
42- "preLaunchTask" : " build-yolo-project" // Ensure the project is built before debugging
45+ // "preLaunchTask": "build-yolo-project" // Ensure the project is built before debugging
4346 }
4447 ]
4548}
Original file line number Diff line number Diff line change 22
33#include < filesystem>
44
5+ // #define LOGGING
56std::tuple<std::unique_ptr<YOLO_V8>, DL_INIT_PARAM> Initialize (const std::filesystem::path& model_filename);
67
78std::vector<DL_RESULT> Detector (std::unique_ptr<YOLO_V8>& p, const cv::Mat& img);
Original file line number Diff line number Diff line change 55#include < iomanip>
66#include < iostream>
77
8- // #define LOGGING
98std::vector<DL_RESULT> Detector (std::unique_ptr<YOLO_V8>& p, const cv::Mat& img) {
109
1110 std::vector<DL_RESULT> res;
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ int main(int argc, char *argv[])
2020
2121 std::tie (yoloDetector, params) = Initialize (model_name);
2222
23- std::filesystem::path current_path = std::filesystem::current_path ();
24- std::filesystem::path imgs_path = current_path / " images" ;
23+ std::filesystem::path imgs_path = argv[2 ];
2524 for (auto & i : std::filesystem::directory_iterator (imgs_path))
2625 {
2726 if (i.path ().extension () == " .jpg" || i.path ().extension () == " .png" || i.path ().extension () == " .jpeg" )
@@ -30,12 +29,14 @@ int main(int argc, char *argv[])
3029 cv::Mat img = cv::imread (img_path);
3130 std::vector<DL_RESULT> results;
3231 results = Detector (yoloDetector, img);
32+ #ifdef LOGGING
3333 for (const auto & result : results)
3434 {
3535 std::cout << " Image path: " << img_path << " \n "
3636 << " class id: " << result.classId << " \n "
3737 << " confidence: " << result.confidence << " \n " ;
3838 }
39+ #endif
3940 }
4041 }
4142
You can’t perform that action at this time.
0 commit comments