def compute_iou(bboxA, bboxB):
    """compute iou of two bounding boxes

    Args:
      bboxA(list): coordinates of box A (i,j,w,h)
      bboxB(list): coordinates of box B (i,j,w,h)

    Return:
      float: iou score
    """

    ix = max(bboxA[0], bboxB[0])
    iy = max(bboxA[1], bboxB[1])
    mx = min(bboxA[0] + bboxA[2], bboxB[0] + bboxB[2])
    my = min(bboxA[1] + bboxA[3], bboxB[1] + bboxB[3])
    area_inter = max(mx - ix, 0) * max(my - iy, 0)
    area_A = bboxA[2] * bboxA[3]
    area_B = bboxB[2] * bboxB[3]

    iou = float(area_inter) / float(area_A + area_B - area_inter)
    return iou