davide-coccomini/Combining-EfficientNet-and-Vision-Transformers-for-Video-Deepfake-Detection

Dateset

czy5638222 opened this issue · 32 comments

hello, i typed this command but why doesn't the system respond
image
image
image
can you help me see what's wrong
thanks!

Hi, you have to replace "path/to/videos" with your correct path to the dataset. For example in your case it should be just "FACEFORENSICS".

814590dd36f308ab98c11aa1e482846
oh sorry, I send wrong
still no response

Could you try to replace the --data_path with "../FACEFORENSICS"?

There are problems with both opencv and thresholds
I have set the thresholds low
And the opencv problem mentioned in the error
Can you help me take a look?

image

Change the --dataset parameter to Faceforensics, it is set by default to DFDC

image

image

Is the dataset download this?

Yes and you have to set --dataset to "FACEFORENSICS" otherwise the code will try to adapt to the structure of DFDC.

image
It's already

image
threshold is low
I don't know why it just doesn't work
please help me

is that correct

def main():
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', default="FACEFORENSICS",type=str,
help='Dataset (DFDC / FACEFORENSICS)')
parser.add_argument('--data_path', default='', type=str,
help='Videos directory')
parser.add_argument("--detector-type", help="type of the detector", default="FacenetDetector",
choices=["FacenetDetector"])

opt = parser.parse_args()
print(opt)

Try to execute the code two times. The first time with --data_path ../FACEFORENSICS//manipulated_sequences
and the second time with --data_path ../FACEFORENSICS/original_sequences

how to execute code twice
Can you tell me the specific steps?
thanks!!!

image

By the way, does the dataset look like this

Yes, the structure is correct. Just open your terminal inside preprocessing folder and execute the command:

python3 detect_faces.py --dataset FACEFORENSICS --data_path ../FACEFORENSICS/manipulated_sequences

This will detect the faces for all the videos inside the manipulated_sequences folder.

When the process is completed you have to run another command:
python3 detect_faces.py --dataset FACEFORENSICS --data_path ../FACEFORENSICS/original_sequences

At the end of this second process, the faces for all the videos inside the original_sequences folder will be detected.

What should I do in the above situation?

I pushed a fix for the utils.py file. You should now be able to detect all the faces after pulling my changing using the following command:
python3 detect_faces.py --dataset FACEFORENSICS --data_path ../FACEFORENSICS

I copied your latest utils.py but it still looks like this
image

Hey
you look at this
Is it because of my dataset error?
Because there is a face in the dataset of actor, he can extract it
Other datasets don't seem to have faces, so an error is reported saying that faces cannot be detected

image
image

You should remove folders like "boxes" from the video folders. "actors" should already be skipped but you have to be sure to not have "boxes" also in other folders. The correct structure of the dataset is:


- FACEFORENSICS
       - manipulated_sequences
                 - Deepfakes
                        - c23
                               - videos
                                       000_003.mp4
                                       ....
                                       999_960.mp4
                    ...
                    NeuralTextures
                           ....
         - original_sequences
                     - youtube
                           - c23
                                  - videos
                                         000.mp4
                                         ...
                                         999.mp4

And nothing else. The "boxes" folder will be automatically created inside "FACEFORENSICS" folder and you need to remove any additional folder you may have in other positions. The expected folders inside manipulated_sequences are Deepfakes, Face2Face, FaceShifter, FaceSwap and NeuralTextures.

image
I deleted all boxes
but still

It seems like it is trying to read the folders as videos instead of looking inside these folders. Are you totally sure that you have the last version of the repository?

is the repository inside environment.yml?
Can you see which ones are the latest?

Just remove the old version you cloned and run again the command:
git clone https://github.com/davide-coccomini/Combining-EfficientNet-and-Vision-Transformers-for-Video-Deepfake-Detection.git

I just tried cloning the repository and running it and it works.

image

Still the same!

This is related to multiprocessing. Probably your system has some peculiarity that causes this error. You can try to change num_workers from 40 to 1 inside detect_faces.py line 22. I will provide an option so that it will be customizable.

image

I got a new error after I changed it to 1

Could you please try to use relative paths? The only difference I see with my approach is that. So go into the preprocessing folder and run the command
python3 detect_faces.py --dataset FACEFORENSICS --data_path ../FACEFORENSICS

image
Relative paths don't seem to work at all

Are you sure the data_path is correct? In your previous screen the FACEFORENSICS folder seems to be outside preprocessing folder. So you should use "--data_path ../FACEFORENSICS" and not "--data_path FACEFORENSICS"

I changed the path to ..\videos
It runs successfully and the boxes are placed directly inside the videos
Please do I copy all the boxes to a folder or keep it as it is
image

You can manage it as you wish just changing the commands args.