yiranran / Audio-driven-TalkingFace-HeadPose

Code for "Audio-driven Talking Face Video Generation with Learning-based Personalized Head Pose" (Arxiv 2020) and "Predicting Personalized Head Movement From Short Video and Speech Signal" (TMM 2022)
https://ieeexplore.ieee.org/document/9894719
721 stars 146 forks source link

Error in background merging using cv2.seamlessClone (file trans_with_bigbg.py) #28

Open ssinha89 opened 4 years ago

ssinha89 commented 4 years ago

I am getting the following error on many videos from VoxCeleb2 test dataset.

File "test_personalized.py", line 105, in merge_with_bigbg(audiobasen,n) File "Audio-driven-TalkingFace-HeadPose/Audio/code/trans_with_bigbg.py", line 76, in merge_with_bigbg output = cv2.seamlessClone(img1,img,mask,center,cv2.NORMAL_CLONE) cv2.error: OpenCV(4.1.0) /io/opencv/modules/core/src/matrix.cpp:466: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat'

I tried to resize the videos (originally 224x224) by increasing frame dimensions but getting the same error. Could you kindly suggest what maybe the issue and how to resolve it ?