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

I think proposal_list[h]=-1 should also be set when imax_overlap < iou_thresh #17

Open
hqy479 opened this issue Aug 2, 2023 · 0 comments

Comments

@hqy479
Copy link

hqy479 commented Aug 2, 2023

def image_eval(pred, gt, ignore, iou_thresh):
""" single image evaluation
pred: Nx5
gt: Nx4
ignore:
"""

_pred = pred.copy()
_gt = gt.copy()
pred_recall = np.zeros(_pred.shape[0])
recall_list = np.zeros(_gt.shape[0])
proposal_list = np.ones(_pred.shape[0])

# _pred[:, 2] = _pred[:, 2] + _pred[:, 0]
# _pred[:, 3] = _pred[:, 3] + _pred[:, 1]
_gt[:, 2] = _gt[:, 2] + _gt[:, 0]
_gt[:, 3] = _gt[:, 3] + _gt[:, 1]

overlaps = bbox_overlaps(_pred[:, :4], _gt)

for h in range(_pred.shape[0]):
    gt_overlap = overlaps[h] 
    max_overlap, max_idx = gt_overlap.max(), gt_overlap.argmax()
    **if max_overlap >= iou_thresh:** 
        if ignore[max_idx] == 0:
            recall_list[max_idx] = -1
            **proposal_list[h] = -1**
        elif recall_list[max_idx] == 0:
            recall_list[max_idx] = 1

    r_keep_index = np.where(recall_list == 1)[0]
    pred_recall[h] = len(r_keep_index)
return pred_recall, proposal_list 
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

1 participant