VISION-SJTU/RECCE

About training and pickle

LonelyPlanetIoT opened this issue · 20 comments

Hi,I notice you said "we train a reconstruction network over genuine images only" I wang to know that is only real images are used during training phase?Or it means the input of the network contains both real and fake but the loss set only focus on the reconstruction of real?
And I meet an error during training.
image

XJay18 commented

Hi, the input to the network contains both real and fake faces. However, the reconstruction loss is computed over real faces only.

The error in your figure is caused by the absence of train_c40.pickle, which is a file storing the image paths and labels for efficient loading and could be created manually following the discussion here.

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ?
2023-06-14 00-44-23屏幕截图
2023-06-14 00-44-41屏幕截图
2023-06-14 00-55-09屏幕截图(复件)

XJay18 commented

Hi, we store the list via the torch.save API, but not the pickle.dump API.
Since we load the list using torch.load, saving it with pickle.dump will cause an error.

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ? 2023-06-14 00-44-23屏幕截图 2023-06-14 00-44-41屏幕截图 2023-06-14 00-55-09屏幕截图(复件)

Hi , I made the pickle as folling code and the data structure is here . But it still occurs an error . How do you make pickle file ? 2023-06-14 00-44-23屏幕截图 2023-06-14 00-44-41屏幕截图 2023-06-14 00-55-09屏幕截图(复件)

I use torch.save(dict,path/to/dict). It seems to work.It is too late. I will do more tries tommorw and show result here.

Hi, we store the list via the torch.save API, but not the pickle.dump API. Since we load the list using torch.load, saving it with pickle.dump will cause an error.

I create the pickle by torch.save now. It works now! And I want to ask how many frames do you use for training FF++ per video? 50? 100? or 150?

XJay18 commented

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

Thank you for patiently answering my question

数据集格式是怎样的,如何制作?

XJay18 commented

@yqj0919
Hi, the dataset structure for FaceForensics++ in this repo follows the original structure specified by the official github of FaceForensics++. You may download the original data there. Alternatively, if you do not want to download and process the raw video data yourself, you can send me an email (to junyicao@sjtu.edu.cn) to request our preprocessed FaceForensics++ dataset.

Hi,Shall I ask a simple question? The training code uses distribution , but I run it successfully on a single GPU. Is It harm for the result? Because I get a nearly same result when use model_param_ffpp_c40.bin test FF++c40(Download from the link shared by your email). The result decreases to 87.25 when I train the model on my own device .
Best Wishes!

XJay18 commented

Hi, although the training code uses torch.distributed package to train the models, it should work fine on a single GPU device. Could you report more training details, e.g., do you modify the training code, which training config file you used.

Sorry for the late reply. Here is my config.yml and the trainning code.
settings.zip

I add the test into the training code for convenient
Best Regards!

Sorry for the late reply. Here is my config.yml and the trainning code. settings.zip

I add the test into the training code for convenient Best Regards!
Hi,
I change the code into training for single GPU ,And I got the 90.96ACC ,95.43AUC on FF++ dataset after 15 epoch. But I am not sure I set the pretrained ==True during the training in distributed way.
By the way, The wilddeepfake dataset has been cut into faces. Do they need to do any other preprocessing?
Best Regards!

XJay18 commented

Hi, sorry for the late reply as I am having a tight schedule recently.

As mentioned in your last comment, I think the training code is okay. Regarding WildDeepfake dataset, as it is already in image format, we do not perform other preprocessing steps. We just read the raw rgb images and use the corresponding dataloader for loading the data.

Best Regards!

XJay18 commented

Close due to inactivation. Please feel free to reopen this issue if you still have related problems.

We sample about 12 frames per fake video for training FF++, which results in 36,000 (=~12.5 frames/video×720 videos×4 manipulated techniques) fake images. The number of real images used for training is also 36,000 (=~50 frames/video×720 videos).

Thank you for patiently answering my question

Hi, I have recently been Learning the code of this article "End-to-End Reconstruction-Classification Learning for Face Forgery Detection". First of all, I have encountered problems in the part of preprocessing images. I saw your words in the issues section and would like to ask about it. What kind of pickle do you make? What is the structure of pickle? Do you crop 720 out of 1,000 videos?". / manipulated_sequences/Deepfakes/c40 / videos / 000 _003. Mp4 "such a path is wrong?

@yqj0919 Hi, the dataset structure for FaceForensics++ in this repo follows the original structure specified by the official github of FaceForensics++. You may download the original data there. Alternatively, if you do not want to download and process the raw video data yourself, you can send me an email (to junyicao@sjtu.edu.cn) to request our preprocessed FaceForensics++ dataset.

Hi, can you provide the preprocessing part and the .pickle data set? There is a problem with this part of the preprocessing work. My email is 997834890@qq.com.
Best Regards!

@jesslos Hi, please check your email for the preprocessed FaceForensics++ dataset.