nii-yamagishilab / ClassNSeg

Implementation and demonstration of the paper: Multi-task Learning for Detecting and Segmenting Manipulated Facial Images and Videos
BSD 3-Clause "New" or "Revised" License
78 stars 12 forks source link

'input_mask' is what? How to generate? #3

Open LGRY opened 3 years ago

LGRY commented 3 years ago

https://github.com/nii-yamagishilab/ClassNSeg/blob/87e506fddb9f36ef14f9bd1f6496f86d7faef0fd/create_dataset_Deepfakes.py#L103

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.

honghuy127 commented 3 years ago

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 3 years ago

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

honghuy127 commented 3 years ago

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

Nemesis0416 commented 2 years ago

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

honghuy127 commented 2 years ago

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

Nemesis0416 commented 2 years ago

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

honghuy127 commented 2 years ago

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

jishenghuang commented 2 years ago

'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!

honghuy127 commented 2 years ago

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'.

YuXiaolu801 commented 3 months ago

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'?

honghuy127 commented 3 months ago

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 --