Skip to content

Commit ec2c4c7

Browse files
committed
fix main.cpp
1 parent 06439ac commit ec2c4c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main()
1313
std::tie(yoloDetector, params) = Initialize();
1414

1515
std::filesystem::path current_path = std::filesystem::current_path();
16-
std::filesystem::path imgs_path = "/home/amigo/Documents/repos/hero_sam.bak/sam_inference/build/images";
16+
std::filesystem::path imgs_path = current_path / "images";
1717
for (auto& i : std::filesystem::directory_iterator(imgs_path))
1818
{
1919
if (i.path().extension() == ".jpg" || i.path().extension() == ".png" || i.path().extension() == ".jpeg")
@@ -22,6 +22,12 @@ int main()
2222
cv::Mat img = cv::imread(img_path);
2323
std::vector<DL_RESULT> results;
2424
results = Detector(yoloDetector, img);
25+
for (const auto& result : results)
26+
{
27+
std::cout << "Image path: " << img_path << "\n"
28+
<< "class id: " << result.classId << "\n"
29+
<< "confidence: " << result.confidence << "\n";
30+
}
2531
}
2632
}
2733

0 commit comments

Comments
 (0)