deepinsight / deepinsight/insightface

`np.int` was a deprecated alias for the builtin `int`.

Open
#2,695 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

I run the example snippet
```
import cv2
import numpy as np
import insightface
from insightface.app import FaceAnalysis
from insightface.data import get_image as ins_get_image

app = FaceAnalysis(providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
app.prepare(ctx_id=0, det_size=(640, 640))
img = ins_get_image('t1')
faces = app.get(img)
rimg = app.draw_on(img, faces)
cv2.imwrite("./t1_output.jpg", rimg)
```

output:
```
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\Administrator/.insightface\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (640, 640)
Traceback (most recent call last):
File "c:\Users\Administrator\Desktop\face_detect\face_detect.py", line 11, in
rimg = app.draw_on(img, faces)
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\sdk\miniconda3\envs\face_detect\Lib\site-packages\insightface\app\face_analysis.py", line 84, in draw_on
box = face.bbox.astype(np.int)
^^^^^^
File "D:\sdk\miniconda3\envs\face_detect\Lib\site-packages\numpy\__init__.py", line 410, in __getattr__
raise AttributeError(__former_attrs__[attr], name=None)
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.