Skip to content

Fix NumPy 1.24+ compatibility and ValueError shape crashes#1042

Open
fayerman-source wants to merge 1 commit into
OpenTalker:mainfrom
fayerman-source:numpy-compatibility-fix
Open

Fix NumPy 1.24+ compatibility and ValueError shape crashes#1042
fayerman-source wants to merge 1 commit into
OpenTalker:mainfrom
fayerman-source:numpy-compatibility-fix

Conversation

@fayerman-source
Copy link
Copy Markdown

This PR fixes two critical compatibility issues when running SadTalker on modern python stacks:

  1. NumPy 1.24+ AttributeError:
    In src/face3d/util/my_awing_arch.py, calling np.float raises AttributeError: module 'numpy' has no attribute 'float' on NumPy versions 1.24 and above. This is fixed by using Python's built-in float type.

  2. ValueError setting array element with a sequence:
    In src/face3d/util/preprocess.py, trans_params = np.array([w0, h0, s, t[0], t[1]]) raises ValueError: setting an array element with a sequence in newer NumPy versions when elements are inhomogeneous. This is fixed by explicitly casting parameters to scalar floats.

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.

1 participant