fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

compute overlap using width x2-x1 width #1358

Closed brunoeducsantos closed 4 years ago

brunoeducsantos commented 4 years ago

Hi, I just want rectify the extra +1 in computation of width and height in overlap evaluation. Let me know if it makes sense.

Regards, Bruno

brunoeducsantos commented 4 years ago

Thanks for the feedback. Spaces removed

brunoeducsantos commented 4 years ago

Hi @hgaiser , Could I be added to the list of contributors? Thanks a lot, Bruno

hgaiser commented 4 years ago

Could you make a PR for that ? ^^

brunoeducsantos commented 4 years ago

Sorry, I didnt understand. What do you mean a PR for that?

hgaiser commented 4 years ago

Usually people add themselves to https://github.com/fizyr/keras-retinanet/blob/master/CONTRIBUTORS.md in a PR.

bw4sz commented 4 years ago

I just confirmed that the following fails on latest release (OSX), but is solved by this pull request. Somewhat high priority.

(test) MacBook-Pro:keras-retinanet ben$ python
Python 3.7.6 | packaged by conda-forge | (default, Jun  1 2020, 18:33:30)
[Clang 9.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from keras_retinanet.utils.anchors import compute_overlap
Using TensorFlow backend.
>>> import numpy as np
>>>
>>> true_array = np.expand_dims(np.array([0.,0.,5.,5.]),axis=0)
>>> prediction_array = np.expand_dims(np.array([0.,0.,10.,10.]), axis=0)
>>> retinanet_iou = compute_overlap(prediction_array,true_array)
>>> assert retinanet_iou[0][0] == (5**2/10**2)