Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this code run under python3.6? #7

Closed
aaawrong opened this issue Apr 16, 2022 · 5 comments
Closed

Can this code run under python3.6? #7

aaawrong opened this issue Apr 16, 2022 · 5 comments

Comments

@aaawrong
Copy link

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
Copy link
Owner

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
Copy link
Author

aaawrong commented Apr 16, 2022

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
Copy link
Owner

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
Copy link
Owner

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

@aaawrong
Copy link
Author

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

Sorry for the late reply, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants