Skip to content

Commit 24e1951

Browse files
committed
npy no deprecated api
1 parent 097705b commit 24e1951

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Differences between original repository and fork:
99
* UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument.
1010
* DeprecationWarning: 'np.float' is a deprecated alias for builtin 'float'.
1111
* FutureWarning: Cython directive 'language_level' not set.
12+
* Cython Warning: Using deprecated NumPy API.
1213
* No unnecessary files.
1314

1415
# Installation

widerface_evaluate/box_overlaps.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def bbox_overlaps(
2424
-------
2525
overlaps: (N, K) ndarray of overlap between boxes and query_boxes
2626
"""
27-
cdef unsigned int N = boxes.shape[0]
28-
cdef unsigned int K = query_boxes.shape[0]
27+
cdef unsigned int N = (<object> boxes).shape[0]
28+
cdef unsigned int K = (<object> query_boxes).shape[0]
2929
cdef np.ndarray[DTYPE_t, ndim=2] overlaps = np.zeros((N, K), dtype=DTYPE)
3030
cdef DTYPE_t iw, ih, box_area
3131
cdef DTYPE_t ua

widerface_evaluate/setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
from Cython.Build import cythonize
1010
import numpy
1111

12-
package = Extension('bbox', ['box_overlaps.pyx'], include_dirs=[numpy.get_include()])
12+
package = Extension(
13+
'bbox',
14+
['box_overlaps.pyx'],
15+
include_dirs=[numpy.get_include()],
16+
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
17+
)
1318
setup(ext_modules=cythonize([package], language_level='3str'))

0 commit comments

Comments
 (0)