GP-UNIT icon indicating copy to clipboard operation
GP-UNIT copied to clipboard

How to train Encoder on custom data?

Open raviy0807 opened this issue 1 year ago • 2 comments

Hi,

I referred to data_preparation but its not clear if i want to use this GP-UNIT for custom dataset where encoder training will also be required.

For example, I have dataset of Face Spoof attack like https://paperswithcode.com/dataset/casia-mfsd . Where my task is to convert Non-Spoof Images to Spoof Images.

So my understanding is , I would require to re-train the encoder as task and encoder data is totally different. Please, let me know if that's not the case ?

Now, assuming i would like to train the encoder only on spoof face and non spoof face image. How would i train the encoder and prepare the data?

Thanks for the great work @williamyang1991

raviy0807 avatar Mar 02 '23 11:03 raviy0807

Our pretrained encoder works for non-ImageNet images, such as MS-COCO giraffes, Yosemite landscapes and Artistic portraits. I think you can try the pretrained encoder first to see whether it also works for your Non-Spoof Images and Spoof Images.

If it does not work, you can add your data into ImageNet291 just as 1001_face for training image

williamyang1991 avatar Mar 02 '23 11:03 williamyang1991

Thank you @williamyang1991

I will try pretrained encoder, but it just from my experience it does not works well as spoof faces have high degree of variation.

Now if i take 2nd method of training the encoder. Then following are the question based on only 1 read:

  • Will i require the segmentation mask?
  • In reference to data preparation, Do i need to do anything in synImageNet291 ? Is it require for custom or not?
  • '''python generate_ImageNet291.py'' Use this command to re-train

Download CelebA-HQ and put the 29000 training images and 1000 testing images to ImageNet291/train/1001_face/ and ImageNet291/test/1001_face/, respectively.

As written in data preparation, should i simple create 2 folder :

  • spoof
  • non_spoof and add these in ImageNet291

Idea is to understand how to add new classes and perform on new task.

raviy0807 avatar Mar 02 '23 13:03 raviy0807