Skip to content

fix: NumPy >=1.24 compatibility#1031

Open
Mr-Neutr0n wants to merge 1 commit intoOpenTalker:mainfrom
Mr-Neutr0n:fix/numpy-compatibility
Open

fix: NumPy >=1.24 compatibility#1031
Mr-Neutr0n wants to merge 1 commit intoOpenTalker:mainfrom
Mr-Neutr0n:fix/numpy-compatibility

Conversation

@Mr-Neutr0n
Copy link

Summary

Fixes compatibility issues when running SadTalker with NumPy >= 1.24.

Problems Fixed

1. np.float deprecation

AttributeError: module 'numpy' has no attribute 'float'

np.float was deprecated in NumPy 1.20 and removed in NumPy 1.24.

Fix: Replaced np.float with np.float64 in:

  • src/face3d/util/my_awing_arch.py
  • src/face3d/models/arcface_torch/torch2onnx.py

2. ValueError in align_img

ValueError: setting an array element with a sequence

This happened because t[0] and t[1] were arrays instead of scalars.

Fix: Explicitly cast values to float in src/face3d/util/preprocess.py:

trans_params = np.array([float(w0), float(h0), float(s), float(t[0]), float(t[1])])

Fixes #1019


🤖 Generated with Claude Code

- Replace deprecated np.float with np.float64 in my_awing_arch.py
  and torch2onnx.py (np.float was removed in NumPy 1.24)
- Fix ValueError in align_img by explicitly casting t[0] and t[1]
  to float when building trans_params array

Fixes OpenTalker#1019

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mr-Neutr0n
Copy link
Author

hi, any chance this could get reviewed? fixes numpy 1.24+ deprecations (np.float, np.int, etc.) that crash on newer setups

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

Successfully merging this pull request may close these issues.

NumPy ≥1.24 alignment

1 participant