Skip to content

Commit 5e3aaf2

Browse files
Merge pull request #1856 from fzhar/object_detection_demo_ssd_async_common_pipeline
Remove check for threshold in app level (object_detection_demo)
2 parents 7486d69 + d159fe7 commit 5e3aaf2

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

demos/object_detection_demo/main.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -159,35 +159,29 @@ cv::Mat renderDetectionData(const DetectionResult& result) {
159159
}
160160

161161
// Visualizing result data over source image
162-
163-
if (FLAGS_r)
164-
{
162+
if (FLAGS_r) {
165163
slog::info << " Class ID | Confidence | XMIN | YMIN | XMAX | YMAX " << slog::endl;
166164
}
167165

168166
for (auto obj : result.objects) {
169-
if (obj.confidence > static_cast<float>(FLAGS_t)) {
170-
171-
if (FLAGS_r)
172-
{
173-
slog::info << " "
174-
<< std::left << std::setw(9) << obj.label << " | "
175-
<< std::setw(10) << obj.confidence << " | "
176-
<< std::setw(4) << std::max(int(obj.x), 0) << " | "
177-
<< std::setw(4) << std::max(int(obj.y), 0) << " | "
178-
<< std::setw(4) << std::min(int(obj.width), outputImg.cols) << " | "
179-
<< std::setw(4) << std::min(int(obj.height), outputImg.rows)
180-
<< slog::endl;
181-
}
167+
if (FLAGS_r) {
168+
slog::info << " "
169+
<< std::left << std::setw(9) << obj.label << " | "
170+
<< std::setw(10) << obj.confidence << " | "
171+
<< std::setw(4) << std::max(int(obj.x), 0) << " | "
172+
<< std::setw(4) << std::max(int(obj.y), 0) << " | "
173+
<< std::setw(4) << std::min(int(obj.width), outputImg.cols) << " | "
174+
<< std::setw(4) << std::min(int(obj.height), outputImg.rows)
175+
<< slog::endl;
176+
}
182177

183-
std::ostringstream conf;
184-
conf << ":" << std::fixed << std::setprecision(3) << obj.confidence;
178+
std::ostringstream conf;
179+
conf << ":" << std::fixed << std::setprecision(3) << obj.confidence;
185180

186-
cv::putText(outputImg, obj.label + conf.str(),
187-
cv::Point2f(obj.x, obj.y - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1,
188-
cv::Scalar(0, 0, 255));
189-
cv::rectangle(outputImg, obj, cv::Scalar(0, 0, 255));
190-
}
181+
cv::putText(outputImg, obj.label + conf.str(),
182+
cv::Point2f(obj.x, obj.y - 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 1,
183+
cv::Scalar(0, 0, 255));
184+
cv::rectangle(outputImg, obj, cv::Scalar(0, 0, 255));
191185
}
192186

193187
return outputImg;

0 commit comments

Comments
 (0)