OpenTalker / video-retalking

[SIGGRAPH Asia 2022] VideoReTalking: Audio-based Lip Synchronization for Talking Head Video Editing In the Wild
https://opentalker.github.io/video-retalking/
Apache License 2.0
6.12k stars 904 forks source link

setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part. #35

Open zhixingrenai opened 1 year ago

zhixingrenai commented 1 year ago

[Step 2] 3DMM Extraction In Video:: 0%| | 0/135 [00:00<?, ?it/s] Traceback (most recent call last): File "inference.py", line 342, in main() File "inference.py", line 100, in main trans_params, im_idx, lmidx, = align_img(frame, lm_idx, lm3d_std) File "G:\pythonProject\third_part\face3d\util\preprocess.py", line 196, in align_img trans_params = np.array([w0, h0, s, t[0], t[1]]) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part. PS G:\pythonProject>

zhixingrenai commented 1 year ago

step 2 error, who know it, thank you

kunncheng commented 1 year ago

There is a similar issue. What is your numpy version

deepakkupanda commented 1 year ago

Replace the line trans_params = np.array([w0, h0, s, np.asscalar(t[0]), np.asscalar(t[1])]) with below lines trans_params = np.array([w0, h0, s]) trans_params = np.append(trans_params, t[0]) trans_params = np.append(trans_params, t[1]) It worked for me.

zhixingrenai commented 1 year ago

is ok now, numpy version change is ok

Inferencer commented 1 year ago

as I am having the same error what fixed it was it the numpy version change? what version did you end up using?

Edit: I fixed mine by following deepakkupandas fix of editing the preproccess file, i also changed the numpy version

jasonpraful commented 1 year ago

downgrading to numpy==1.23.1 fixed it without having to replace any text as stated above