|
12 | 12 | #define USE_FP16 // set USE_INT8 or USE_FP16 or USE_FP32 |
13 | 13 | #define DEVICE 0 // GPU id |
14 | 14 | #define BATCH_SIZE 1 |
15 | | -#define VIS_THRESH 0.6 |
| 15 | +#define CONF_THRESH = 0.75 |
| 16 | +#define IOU_THRESH = 0.4 |
16 | 17 |
|
17 | 18 | // stuff we know about the network and the input/output blobs |
18 | 19 | static const int INPUT_H = decodeplugin::INPUT_H; // H, W must be able to be divided by 32. |
@@ -349,13 +350,13 @@ int main(int argc, char** argv) { |
349 | 350 |
|
350 | 351 | for (int b = 0; b < BATCH_SIZE; b++) { |
351 | 352 | std::vector<decodeplugin::Detection> res; |
352 | | - nms(res, &prob[b * OUTPUT_SIZE]); |
| 353 | + nms(res, &prob[b * OUTPUT_SIZE], IOU_THRESH); |
353 | 354 | std::cout << "number of detections -> " << prob[b * OUTPUT_SIZE] << std::endl; |
354 | 355 | std::cout << " -> " << prob[b * OUTPUT_SIZE + 10] << std::endl; |
355 | 356 | std::cout << "after nms -> " << res.size() << std::endl; |
356 | 357 | cv::Mat tmp = img.clone(); |
357 | 358 | for (size_t j = 0; j < res.size(); j++) { |
358 | | - if (res[j].class_confidence < VIS_THRESH) continue; |
| 359 | + if (res[j].class_confidence < CONF_THRESH) continue; |
359 | 360 | cv::Rect r = get_rect_adapt_landmark(tmp, INPUT_W, INPUT_H, res[j].bbox, res[j].landmark); |
360 | 361 | cv::rectangle(tmp, r, cv::Scalar(0x27, 0xC1, 0x36), 2); |
361 | 362 | //cv::putText(tmp, std::to_string((int)(res[j].class_confidence * 100)) + "%", cv::Point(r.x, r.y - 1), cv::FONT_HERSHEY_PLAIN, 1.2, cv::Scalar(0xFF, 0xFF, 0xFF), 1); |
|
0 commit comments