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
239 stars 60 forks source link

How do I train my dataset? #30

Closed JiangdongWang123 closed 2 years ago

JiangdongWang123 commented 2 years ago

Hello! I have the image dataset ready and split it into true and false folders, how can I use them for direct training instead of read_frame()? 图片

davide-coccomini commented 2 years ago

You need to skip the majority of the read_frames function and just use the image reading part. So in your case the dataset reading should be something like:

  1. Read the list of images and put them into paths list;
  2. Pass the list to a read_images function exploiting multiprocessing;
  3. Inside read_images, read the image and put it into the correct shared list/dict with the associated label.

But obviously, you have thousands of ways to do that, this is just a possible approach for loading your dataset.