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

Code for Video Deepfake Detection model from "Combining EfficientNet and Vision Transformers for Video Deepfake Detection" presented at ICIAP 2021.
https://dl.acm.org/doi/abs/10.1007/978-3-031-06433-3_19
MIT License
237 stars 60 forks source link

Dateset #18

Closed czy5638222 closed 2 years ago

czy5638222 commented 2 years ago

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

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

814590dd36f308ab98c11aa1e482846 oh sorry, I send wrong still no response

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

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

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

image

image

Is the dataset download this?

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

image It's already

czy5638222 commented 2 years ago

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

czy5638222 commented 2 years ago

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)
davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

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

czy5638222 commented 2 years ago

image

By the way, does the dataset look like this

davide-coccomini commented 2 years ago

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.

czy5638222 commented 2 years ago

image

image

czy5638222 commented 2 years ago

What should I do in the above situation?

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

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

czy5638222 commented 2 years ago

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

davide-coccomini commented 2 years ago

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.

czy5638222 commented 2 years ago

image I deleted all boxes but still

davide-coccomini commented 2 years ago

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?

czy5638222 commented 2 years ago

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

davide-coccomini commented 2 years ago

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.

czy5638222 commented 2 years ago

image

Still the same!

davide-coccomini commented 2 years ago

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.

czy5638222 commented 2 years ago

image

I got a new error after I changed it to 1

davide-coccomini commented 2 years ago

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

czy5638222 commented 2 years ago

image Relative paths don't seem to work at all

davide-coccomini commented 2 years ago

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"

czy5638222 commented 2 years ago

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

davide-coccomini commented 2 years ago

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