nii-yamagishilab/ClassNSeg

'input_mask' is what? How to generate?

Opened this issue · 11 comments

LGRY commented

image_mask = cv2.imread(os.path.join(input_mask, filename, '0000.png'))

Before that, the path ‘input_mask’ is blank. How can it execute the imread function?
This .py file is create mask image of input image? If it is, how to understand the 'imread' code in 103?
Thank you.

input_mask is a parameter of the function extract_face_videos(input_real, input_fake, input_mask, output_real, output_fake)

It is called in the main function:
extract_face_videos(opt.input_real, opt.input_fake, opt.mask, opt.output_real, opt.output_fake)

Please take a look at the ArgumentParser

wqi1 commented

@LGRY Have you solved this problem? How to get ' input_mask ' ? Thank you !

Hi, there are three scripts named create_dataset_* which you could take a look at them. The dataset must have mask annotation.

Where can I download the script file for generating the mask?

Hi, there are three scripts with the prefix create_dataset_, could you please check them?

Sorry,I couldn‘t find this file:'datasets/FaceForensicsPP/test/masks/manipulated_sequences/Deepfakes/raw/masks'

Hi, you need to download these files from the FaceForensics dataset webpage:
https://github.com/ondyari/FaceForensics/tree/master/original

'datasets/FaceForensicsPP/test/masks/manipulated_sequences/Deepfakes/raw/masks', I think what he needs is what should be in this file directory, and that's what I need.Thank you!

This is the link for the original FaceForensics dataset. When you access it, there is an instruction to fill out a Google Form. They will send you a script to download the dataset, including the mask files, for examples, in 'FaceForensicsPP/test/masks/manipulated_sequences/Deepfakes/raw/masks'.

but the fold 'masks' does not have the file '0000.png',but the line 135 image_mask = cv2.imread(os.path.join(input_mask, filename, str(count).zfill(4) + '.png')) is just behind the process (line 103) we read the '0000.png',so how do we generate the '0000.png'?

Did you download the original version of the dataset, not the "++" version?

Here is the dataset's structure from the official website mentioned above

FaceForensic dataset
|-- test
    |-- altered
    Contains videos that were altered by Face2Face
    |-- mask
    Contains the masks video that were produced by the Face2Face algorithm
    |-- original
    Contains the original videos
|-- train
    -- same as test --
|-- val
    -- same as test --