Skip to content

NumPy ≥1.24 alignment #1019

@tsondo

Description

@tsondo

Hello SadTalker team,
While running SadTalker with recent versions of NumPy, I ran into a couple of errors:

  • Deprecation / crash: np.float is no longer available in NumPy ≥1.24.
    Fix: replaced np.float with np.float64.
  • 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 them to float when building trans_params:
    trans_params = np.array([float(w0), float(h0), float(s), float(t[0]), float(t[1])])
    After these changes, SadTalker runs cleanly on modern NumPy without deprecation warnings or shape errors.
    Thanks for your work on this project — I hope these notes save you some time when updating upstream.
    I didn't bother to fork and fix, because it's just a minor couple of edits in the util dir for my_awing_arch.py and preprocess.py
    Other than that, it runs perfectly in my dockerized a1111. Amazing work!
    Best regards,
    Tsondo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions