Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Non Maximum Suppression #136

Closed
BonJovi1 opened this issue May 26, 2020 · 2 comments
Closed

[Request] Non Maximum Suppression #136

BonJovi1 opened this issue May 26, 2020 · 2 comments

Comments

@BonJovi1
Copy link

Hi AntonMu,

System information

  • What is the top-level directory of the model you are using: TrainYourOwnYolo/3_Inference
  • Have I written custom code (as opposed to using a stock example script provided in the repo): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS High Sierra
  • TensorFlow version (use command below): 1.15.2
  • CUDA/cuDNN version: None
  • GPU model and memory: None, training on my CPU
  • Exact command to reproduce: python Detector.py

Describing the problem

Thanks a lot for the amazing code and documentation, I was able to successfully train the YOLO model on a custom dataset. However while testing/inference, my model detects multiple bounding boxes around the same object. So it says there are two faces even though there is only one. I looked up online and learnt that this problem can be solved using Non Maximum Suppression. I tried implementing it, with the idea that we could only print the bbox with maximum confidence score, but I was unable to do so (I'm not exactly understanding how to use the box_list_list variable). Could you kindly let me know how exactly could we modify your code to achieve this?

Thanks a lot,
Abhinav

@AntonMu
Copy link
Owner

AntonMu commented May 26, 2020

Hi @BonJovi1

You are welcome. There is a related issue here: #124 <- NMS is already part of the code (it is a core component of YOLO).

Do your boxes have similar confidence levels? I recommend trying different confidence thresholds with e.g.

python Detector.py --confidence 0.5

and other thresholds. Generally, the higher the threshold the fewer boxes you will get.

@BonJovi1
Copy link
Author

Hi @AntonMu
Thanks a bunch! I'm sorry, I should've seen the confidence flag feature, somehow missed that. It still wasn't good enough for me though, because I was still getting multiple detections with confidence scores around 0.6.
So I just manually iterated over out_boxes and only picked up those whose out_score was the highest, and that did the job for me! I guess I should've tried it first properly before raising the issue!

Thanks a lot,
Abhinav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants