Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

np.int was a deprecated alias for the builtin int. #2695

Open
Cupcc opened this issue Nov 23, 2024 · 0 comments
Open

np.int was a deprecated alias for the builtin int. #2695

Cupcc opened this issue Nov 23, 2024 · 0 comments

Comments

@Cupcc
Copy link

Cupcc commented Nov 23, 2024

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 <module>
    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
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant