Dateset
czy5638222 opened this issue · 32 comments
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".
Could you try to replace the --data_path with "../FACEFORENSICS"?
Change the --dataset parameter to Faceforensics, it is set by default to DFDC
Yes and you have to set --dataset to "FACEFORENSICS" otherwise the code will try to adapt to the structure of DFDC.
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!!!
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
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.
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.
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.
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
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"
You can manage it as you wish just changing the commands args.