SLADD icon indicating copy to clipboard operation
SLADD copied to clipboard

Question about training

Open phinoo opened this issue 2 years ago • 22 comments

Anybody have reproduced the training process of the model?

phinoo avatar Jun 17 '22 10:06 phinoo

When I train the model use FF-FS datasets, the function of 'getitem' of FFdata.py will first resize the input image to 256*256, then the dlib.get_frontal_face_detector() can't find a face rectange area from the image...

phinoo avatar Jun 17 '22 10:06 phinoo

Could U please tell me how to get the Mask documents?

dandelion915 avatar Jun 27 '22 03:06 dandelion915

Could U please tell me how to get the Mask documents?

you can get the mask file from the video accoding to the file directory masks of each.

phinoo avatar Jun 27 '22 08:06 phinoo

Could anybody tell how can I generate mask file?& How json file is like?

KingSF5 avatar Jun 30 '22 12:06 KingSF5

Read this: https://github.com/ondyari/FaceForensics/tree/master/dataset

python .\faceforensics_download_v4.py "D:/output_path/" 
    -d all # 
    -c c40 # quality {raw, c23, c40}
    -t masks # type {videos, **masks**, models}
    --server EU2

It will look like this: FaceForensics++\manipulated_sequences\Deepfakes\masks\videos\xxx_yyy.mp4

"The ground-truth forgery mask Mgt is created depending on categories of the input images"

if the input image is:

  • adversarial forgery : Mgt is the resized deformed final mask (i.e. Mgt = Md);
  • original forgery from the training dataset: As most datasets provide the ground truth forgery region, we can directly use them as Mgt
  • original pristine from the training dataset: Mgt is an all-zero matrix (i.e. Mgt = 0), indicating there is no forgery region in the input

towzeur avatar Jun 30 '22 20:06 towzeur

Read this: https://github.com/ondyari/FaceForensics/tree/master/dataset

python .\faceforensics_download_v4.py "D:/output_path/" 
    -d all # 
    -c c40 # quality {raw, c23, c40}
    -t masks # type {videos, **masks**, models}
    --server EU2

It will look like this: FaceForensics++\manipulated_sequences\Deepfakes\masks\videos\xxx_yyy.mp4

"The ground-truth forgery mask Mgt is created depending on categories of the input images"

if the input image is:

  • adversarial forgery : Mgt is the resized deformed final mask (i.e. Mgt = Md);
  • original forgery from the training dataset: As most datasets provide the ground truth forgery region, we can directly use them as Mgt
  • original pristine from the training dataset: Mgt is an all-zero matrix (i.e. Mgt = 0), indicating there is no forgery region in the input

Thanks!!! But I have not seen the code of generating adversarial forgery(Maybe it's because of my carelessness). Is the generation of adversarial forgery included in this released codes(repo)?

KingSF5 avatar Jul 01 '22 08:07 KingSF5

1. has anyone meet this warning in the training process? Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration, which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. 2. Meanwhile, the training is so slow when I run the code? is this normal?

MZMMSEC avatar Jul 11 '22 14:07 MZMMSEC

When I train the model use FF-FS datasets, the function of 'getitem' of FFdata.py will first resize the input image to 256*256, then the dlib.get_frontal_face_detector() can't find a face rectange area from the image...

It seems I am facing the same question. Have you solved it? Ignoring the resize step seems inappropriate. I would appreciate it if you could help me out.

ghost avatar Nov 22 '22 08:11 ghost

@ProgrammingTD i think the code presumes all images are face-cropped already so 256*256 will just resize to fit model input size

ucalyptus2 avatar Nov 22 '22 21:11 ucalyptus2

i think the code presumes all images are face-cropped already so 256*256 will just resize to fit model input size

In README.md, the data structure didn't mention the face-cropped step... I tried to resize the input images to 512 * 512, then the dlib.get_frontal_face_detector() could work, but 512 * 512 doesn't match the pretrained XceptionNet. Have you utilized the face-crop methods on FF++ to reproduce this project? Thanks for your comment!

ghost avatar Nov 23 '22 06:11 ghost

@phinoo @ProgrammingTD I am facing the same problem (Face detector failed). Have you managed to find a solution?

AmiraAlsamawi avatar Nov 28 '22 13:11 AmiraAlsamawi

@phinoo @ProgrammingTD I am facing the same problem (Face detector failed). Have you managed to find a solution?

according to 4.1 in paper, the author said "we resize the aligned faces to 256 × 256 for all the samples in training and test datasets" so i think @forkbabu is right . we should crop the faces in original videos and masks. Then the detector could work as planned. but i only tried for a small dataset(about 50 videos)

ghost avatar Nov 29 '22 12:11 ghost

@ProgrammingTD

How did you align the masks? I used dlib to extract and align the faces, but I could not do the same for the masks.

AmiraAlsamawi avatar Dec 04 '22 18:12 AmiraAlsamawi

@ProgrammingTD

How did you align the masks? I used dlib to extract and align the faces, but I could not do the same for the masks.

for each video in FF++, i got the face location parameters from the original video, and use the same parameters in corresponding fake and mask videos to crop them

ghost avatar Dec 06 '22 08:12 ghost

Can you share your code? @ProgrammingTD

githuboflk avatar Jan 05 '23 04:01 githuboflk

Could anybody tell how can I generate mask file?& How json file is like?

Did you solve it? I have the same question as you. Looking forward to your reply.

xi4444x avatar Jan 10 '23 15:01 xi4444x

Can you share your code? @ProgrammingTD

in closed issue, the author offers data processing code

ghost avatar Feb 15 '23 12:02 ghost

Which code is used to mask data?

zpshs avatar Feb 16 '23 07:02 zpshs

Could U please tell me how to get the Mask documents?

Did you solve it? I have the same question as you. Looking forward to your reply.

zpshs avatar Feb 16 '23 08:02 zpshs

@ProgrammingTD How did you align the masks? I used dlib to extract and align the faces, but I could not do the same for the masks.

for each video in FF++, i got the face location parameters from the original video, and use the same parameters in corresponding fake and mask videos to crop them

Can you provide the code? Thank you

in closed issue 10, the author offers data processing code

ghost avatar Mar 31 '23 00:03 ghost

how to do 'image extract processing'? could anyone share the code?

Pudge-tao avatar Apr 18 '23 02:04 Pudge-tao

Have solved it? Can you share the code?

Leesoon1984 avatar Jun 20 '23 06:06 Leesoon1984