edge-tpu-tiny-yolo icon indicating copy to clipboard operation
edge-tpu-tiny-yolo copied to clipboard

※important※ Mistake in nms_boxes() of util.py

Open YsYusaito opened this issue 3 years ago • 3 comments

Hi, @guichristmann

There are mistakes in NMS processing. ・errors

  1. NMS applies regardless of class.
  2. Inappropriate class reference during NMS processing

・code corrections ■utils.py - line 120,121 delete 「#」(comment out) ■utils.py - line 128,136 correct indents following bellow

※before correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□□□□□i += 1

※after correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□i += 1

By correcting like this, I could obtain appropriate inference result.

YsYusaito avatar Mar 18 '21 02:03 YsYusaito

This is a critical bug that needs fixing asap.

simonm3 avatar May 22 '21 18:05 simonm3

@simonm3 sorry, I made a mistake. I corrected my comment.

Hi, @guichristmann

There are mistakes in NMS processing. ・errors

  1. NMS applies regardless of class.
  2. Inappropriate class reference during NMS processing

・code corrections ■utils.py - line 120,121 delete 「#」(comment out) ■utils.py - line 128,136 correct indents following bellow

※before correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□□□□□i += 1

※after correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□□i += 1

By correcting like this, I could obtain appropriate inference result.

YsYusaito avatar Jun 28 '21 10:06 YsYusaito

Hi, @guichristmann

There are mistakes in NMS processing. ・errors

  1. NMS applies regardless of class.
  2. Inappropriate class reference during NMS processing

・code corrections ■utils.py - line 120,121 delete 「#」(comment out) ■utils.py - line 128,136 correct indents following bellow

※before correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□□□□□i += 1

※after correction □□□if len(to_remove) != 0: □□□□□# Remove boxes □□□□□for r in to_remove[::-1]: □□□□□□□del boxes[r] □□□□□□□del scores[r] □□□□□□□del classes[r] □□□□i += 1

Thank you for this bug fix, you're amazin! :). Initially, I could oly detect only 1 out of 5 classes. After modifying the code, now I am able to detect 2 out of 5 classes. But other 3 classes remains undetected. :(

@YsYusaito Is there any other thing, that I have to fix and modify in the code to get all the classes detected? Thank you again for your input.

AkkiSony avatar Aug 24 '21 07:08 AkkiSony