DetectionTeamUCAS / FPN_Tensorflow

This is a tensorflow re-implementation of Feature Pyramid Networks for Object Detection.
https://github.com/DetectionTeamUCAS/FPN_Tensorflow
MIT License
347 stars 132 forks source link

compute iou #126

Closed guker closed 4 years ago

guker commented 4 years ago

https://github.com/DetectionTeamUCAS/FPN_Tensorflow/blob/fd3fd9d5a04396c24d598d59f3e5ccef8c01aead/libs/val_libs/voc_eval.py#L184-L191

why add 1.? so should modify as follow:

    iw = np.maximum(ixmax - ixmin, 0.) 
    ih = np.maximum(iymax - iymin, 0.) 
    inters = iw * ih 

    # union 
    uni = ((bb[2] - bb[0]) * (bb[3] - bb[1]) + 
        (BBGT[:, 2] - BBGT[:, 0]) * 
        (BBGT[:, 3] - BBGT[:, 1]) - inters) 
yangxue0827 commented 4 years ago

防止有些数据wh计算出来是0