iperov / DeepFaceLive

Real-time face swap for PC streaming or video calls
GNU General Public License v3.0
26.66k stars 4.57k forks source link

Exception raised when face opacity is changed #23

Closed Cioscos closed 3 years ago

Cioscos commented 3 years ago

Hi! When I try to change the face opacity from the frame merger and the selected device for it is the CPU, frame merger module stop to work and it raises an exception.

FaceMerger error: Iterator requested dtype could not be cast from dtype('float64') to dtype('float32'), the operand 0 dtype, according to the rule 'safe' Traceback (most recent call last):
  File "U:\DeepFake_softwares\DeepFaceLive_NVIDIA\_internal\DeepFaceLive\xlib\mp\csw\CSWBase.py", line 484, in _start_proc
    self.on_tick()
  File "U:\DeepFake_softwares\DeepFaceLive_NVIDIA\_internal\DeepFaceLive\apps\DeepFaceLive\backend\FaceMerger.py", line 350, in on_tick
    merged_frame = self._merge_on_cpu(out_merged_frame, frame_image, face_resolution, face_align_img, face_align_mask_img, face_align_lmrks_mask_img, face_swap_img, face_swap_mask_img, aligned_to_source_uni_mat, frame_width, frame_height )
  File "U:\DeepFake_softwares\DeepFaceLive_NVIDIA\_internal\DeepFaceLive\apps\DeepFaceLive\backend\FaceMerger.py", line 252, in _merge_on_cpu
    ne.evaluate('frame_image*(one_f-frame_face_mask) + frame_image*frame_face_mask*(one_f-opacity) + frame_face_swap_img*frame_face_mask*opacity', out=out_merged_frame)
  File "U:\DeepFake_softwares\DeepFaceLive_NVIDIA\_internal\python\lib\site-packages\numexpr\necompiler.py", line 836, in evaluate
    return compiled_ex(*arguments, **kwargs)
TypeError: Iterator requested dtype could not be cast from dtype('float64') to dtype('float32'), the operand 0 dtype, according to the rule 'safe'

With GPU is alright.

iperov commented 3 years ago

thx fixed