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

※important※ Mistake in iou() of util.py #21

Open
YsYusaito opened this issue Jun 28, 2021 · 3 comments
Open

※important※ Mistake in iou() of util.py #21

YsYusaito opened this issue Jun 28, 2021 · 3 comments

Comments

@YsYusaito
Copy link

YsYusaito commented Jun 28, 2021

I added exception handling.
def iou(box1, box2):
    xi1 = max(box1[0][0], box2[0][0])
    yi1 = max(box1[0][1], box2[0][1])
    xi2 = min(box1[1][0], box2[1][0])
    yi2 = min(box1[1][1], box2[1][1])
    
    if(((xi2 - xi1) < 0) or ((yi2 - yi1) < 0)):
        IoU = 0
        return IoU
    else:
        inter_area = (xi2 - xi1)*(yi2 - yi1)
        
        # Formula: Union(A,B) = A + B - Inter(A,B)
        box1_area = (box1[1][1] - box1[0][1])*(box1[1][0]- box1[0][0])
        box2_area = (box2[1][1] - box2[0][1])*(box2[1][0]- box2[0][0])
        union_area = (box1_area + box2_area) - inter_area
        # compute the IoU
        IoU = inter_area / union_area
    
        return IoU
@AkkiSony
Copy link

@YsYusaito Hi. Did you get yolov3 running using inference script? I could not get any object detection suing the inference script.
Please let me know if you got it running. Thanks in advance. :)

@YsYusaito
Copy link
Author

@AkkiSony Hi, I executed yolov3 object detection using inference script. For reference, I wrote my inference environment in issue #23.

@AkkiSony
Copy link

@YsYusaito Thank you very much for sharing your environment issue. Did you make any changes in the inference.py and utils.py script for getting the objects detected. Please let me know if so.
Would it be possible for you to share your utils.py and inference.py script? It would really help me to get yolov3 run on coral TPU. :)
Thanks in advance! :)

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