hacksider / Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image
GNU Affero General Public License v3.0
35.08k stars 4.96k forks source link

AttributeError: 'NoneType' object has no attribute 'normed_embedding' #87

Open kyouko2407 opened 1 month ago

kyouko2407 commented 1 month ago

Hi, Im currently using on Windows. I belive that i did everything correctlybut it has this error when I run it:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Kyouk0\miniconda3\envs\DeepFakeCam\lib\tkinter\__init__.py", line 1921, in __call__
    return self.func(*args)
  File "C:\Users\Kyouk0\miniconda3\envs\DeepFakeCam\lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
    self._command()
  File "C:\Users\Kyouk0\Documents\DeepFakeCam\Deep-Live-Cam\modules\ui.py", line 104, in <lambda>
    live_button = ctk.CTkButton(root, text='Live', cursor='hand2', command=lambda: webcam_preview())
  File "C:\Users\Kyouk0\Documents\DeepFakeCam\Deep-Live-Cam\modules\ui.py", line 286, in webcam_preview
    temp_frame = frame_processor.process_frame(source_image, temp_frame)
  File "C:\Users\Kyouk0\Documents\DeepFakeCam\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 60, in process_frame
    temp_frame = swap_face(source_face, target_face, temp_frame)
  File "C:\Users\Kyouk0\Documents\DeepFakeCam\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 48, in swap_face
    return get_face_swapper().get(temp_frame, target_face, source_face, paste_back=True)
  File "C:\Users\Kyouk0\miniconda3\envs\DeepFakeCam\lib\site-packages\insightface\model_zoo\inswapper.py", line 50, in get
    latent = source_face.normed_embedding.reshape((1,-1))
AttributeError: 'NoneType' object has no attribute 'normed_embedding'

Can someone help me to solve this problem?

pdtan commented 1 month ago

change other source image

KewkLW commented 1 month ago

Basically, the select face image couldn't find a face. Seems to like it when there's shoulders involved.