YuanxunLu / LiveSpeechPortraits

Live Speech Portraits: Real-Time Photorealistic Talking-Head Animation (SIGGRAPH Asia 2021)
MIT License
1.16k stars 200 forks source link

about Image2Image translation inference issue #35

Closed GuichenSociety closed 2 years ago

GuichenSociety commented 2 years ago
  1. Image2Image translation & Saving results... Image2Image translation inference: 0%| | 0/672 [00:00<?, ?it/s] Traceback (most recent call last): File "demo.py", line 264, in facedataset.dataset.image_pad) File "C:\Users\23046\LiveSpeechPortraits\datasets\face_dataset.py", line 280, in get_data_test_mode feature_map = torch.from_numpy(self.get_feature_image(landmarks, (self.opt.loadSize, self.opt.loadSize), shoulder, pad)[np.newaxis, :].astype(np.float32)/255.) File "C:\Users\23046\LiveSpeechPortraits\datasets\face_dataset.py", line 287, in get_feature_image im_edges = self.draw_face_feature_maps(landmarks, size) File "C:\Users\23046\LiveSpeechPortraits\datasets\face_dataset.py", line 317, in draw_face_feature_maps im_edges = cv2.line(im_edges, tuple(keypoints[edge[i]]), tuple(keypoints[edge[i+1]]), 255, 2) cv2.error: OpenCV(4.5.4) :-1: error: (-5:Bad argument) in function 'line'

    Overload resolution failed:

    • Can't parse 'pt1'. Sequence item with index 0 has a wrong type
    • Can't parse 'pt1'. Sequence item with index 0 has a wrong type
GuichenSociety commented 2 years ago

这个问题怎么解决。

sd707589 commented 2 years ago

I had encountered the same problem. Here was my solution:

ps1 = [int(x) for x in edge[i]]
ps2 = [int(x) for x in edge[i+1]]
im_edges = cv2.line(im_edges, ps1, ps2, 255, 2)

Hope it help.

YuanxunLu commented 2 years ago

This is an OpenCV version issue. Please check #29.