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

license_plate_detection_yunet NMSBoxes call with wrong bboxes #275

Open
tomchen1000 opened this issue Sep 23, 2024 · 1 comment
Open

license_plate_detection_yunet NMSBoxes call with wrong bboxes #275

tomchen1000 opened this issue Sep 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tomchen1000
Copy link

tomchen1000 commented Sep 23, 2024

Hi @fengyuentau ,

It seems to me in lpd_yunet.py (under models/license_plate_detection_yunet), the bboxes parameter of the call to NMSBoxes contains wrong data. dets[:, :-1] is array of (x,y) coordinates of 4 corners, i.e. 8 numbers of [x1, y1, x2, y2, x3, y3, x4, y4], so dets[:, 0:4].tolist() is [x1, y1, x2, y2], however bboxes of NMSBoxes expects bounding box in the form of [x, y, width, height].

    # NMS
    keepIdx = cv.dnn.NMSBoxes(
        bboxes=dets[:, 0:4].tolist(),
        scores=dets[:, -1].tolist(),
        score_threshold=self.confidence_threshold,
        nms_threshold=self.nms_threshold,
        top_k=self.top_k
    ) # box_num x class_num
@fengyuentau
Copy link
Member

@tomchen1000 Thank you for digging into the problem. You are welcome to submit a patch to fix this.

@fengyuentau fengyuentau self-assigned this Sep 24, 2024
@fengyuentau fengyuentau added the bug Something isn't working label Sep 24, 2024
@fengyuentau fengyuentau added this to the 5.0 milestone Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants