Commit e72145c
Fixes # 8369
### Description
Fixes an issue where the result of `box_iou` was 0 when the first
argument was an integer, as described in #8369.
IOU values range from 0 to 1. If the first argument is an integer, the
function could return an integer less than 1, resulting in a return
value of 0.
This pull request changes the return type of `box_iou` to `float32`, or
to match the float data type of the first argument.
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
---------
Signed-off-by: reworld223 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: YunLiu <[email protected]>
1 parent 579cec5 commit e72145c
2 files changed
+75
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
830 | 833 | | |
831 | 834 | | |
832 | 835 | | |
| |||
842 | 845 | | |
843 | 846 | | |
844 | 847 | | |
845 | | - | |
| 848 | + | |
846 | 849 | | |
| 850 | + | |
| 851 | + | |
847 | 852 | | |
848 | 853 | | |
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
852 | 857 | | |
853 | 858 | | |
854 | | - | |
| 859 | + | |
855 | 860 | | |
856 | 861 | | |
857 | 862 | | |
| |||
867 | 872 | | |
868 | 873 | | |
869 | 874 | | |
870 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
871 | 879 | | |
872 | 880 | | |
873 | 881 | | |
| |||
904 | 912 | | |
905 | 913 | | |
906 | 914 | | |
| 915 | + | |
| 916 | + | |
907 | 917 | | |
| 918 | + | |
908 | 919 | | |
909 | 920 | | |
910 | 921 | | |
911 | 922 | | |
912 | | - | |
| 923 | + | |
913 | 924 | | |
914 | 925 | | |
915 | 926 | | |
| |||
925 | 936 | | |
926 | 937 | | |
927 | 938 | | |
928 | | - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
929 | 943 | | |
930 | 944 | | |
931 | 945 | | |
| |||
982 | 996 | | |
983 | 997 | | |
984 | 998 | | |
| 999 | + | |
| 1000 | + | |
985 | 1001 | | |
| 1002 | + | |
986 | 1003 | | |
987 | 1004 | | |
988 | 1005 | | |
989 | 1006 | | |
990 | | - | |
| 1007 | + | |
991 | 1008 | | |
992 | 1009 | | |
993 | 1010 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
221 | 272 | | |
222 | 273 | | |
0 commit comments