ahaliassos / LipForensics

Lips Don't Lie: A Generalisable and Robust Approach to Face Forgery Detection (CVPR 2021)
MIT License
122 stars 28 forks source link

Can this code run under python3.6? #7

Closed aaawrong closed 2 years ago

aaawrong commented 2 years ago

Hi,thank you for sharing and I want to ask for some help

my scipy version is 1.5.4 and I cant install the 1.7.1

when I run the code ,it make a mistake

Processing Face2Face... 0%| | 0/1000 [00:00<?, ?it/s] Traceback (most recent call last): File "preprocessing/crop_mouths.py", line 199, in main() File "preprocessing/crop_mouths.py", line 195, in main crop_video_and_save(video_dir, landmarks_dir, target_dir, mean_face_landmarks, args) File "preprocessing/crop_mouths.py", line 122, in crop_video_and_save smoothed_landmarks[STABLE_POINTS, :], mean_face_landmarks[STABLE_POINTS, :], cur_frame, STD_SIZE File "F:\master-data\deepfake\LipForensics\preprocessing\utils.py", line 24, in warp_img tform = tf.estimate_transform("similarity", src, dst) # find the transformation matrix File "F:\Anaconda3\envs\pytorch19\lib\site-packages\skimage\transform_geometric.py", line 1408, in estimate_transform tform.estimate(src, dst, **kwargs) File "F:\Anaconda3\envs\pytorch19\lib\site-packages\skimage\transform_geometric.py", line 1169, in estimate self.params = _umeyama(src, dst, True) File "F:\Anaconda3\envs\pytorch19\lib\site-packages\skimage\transform_geometric.py", line 109, in _umeyama A = dst_demean.T @ src_demean / num ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 960 is different from 5)

ahaliassos commented 2 years ago

Hi, we only tested the code with python 3.8 and the versions of the packages as listed in requirements.txt. I would suggest creating a new conda environment with python 3.8 and then pip installing from requirements.txt. Hope that helps.

aaawrong commented 2 years ago

Thanks for your reply!And sorry to bother you again. I tried using python3.8 and the requirements.But when I run the crop_mouths.py,it still make a mistake. The landmark pictures (png) I made are 960x480, and then I turn then into npy. Maybe there was a mistake here?

File "F:\Anaconda3\envs\py38torch19\lib\site-packages\skimage\transform_geometric.py", line 1621, in estimate_transform tform.estimate(src, dst, *args, **kwargs) File "F:\Anaconda3\envs\py38torch19\lib\site-packages\skimage\transform_geometric.py", line 1362, in estimate self.params = _umeyama(src, dst, estimate_scale=True) File "F:\Anaconda3\envs\py38torch19\lib\site-packages\skimage\transform_geometric.py", line 128, in _umeyama A = dst_demean.T @ src_demean / num ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 960 is different from 5)

ahaliassos commented 2 years ago

In what format are the landmarks you use? The numpy array of the landmarks for each frame must be of size (68, 2), i.e., there are 68 landmarks per frame. You can use FAN to compute them.

ahaliassos commented 2 years ago

Closing this now. Please reopen if you're still having issues.

aaawrong commented 2 years ago

Closing this now. Please reopen if you're still having issues.

Sorry for the late reply, thanks for your help.