- Open a terminal window
- Clone the repo
pip install -r requirements.txt
For fine-tuning on your dataset using e.g. the fine tuned ViT:
- Open ViT_fine_tuned.py
- Specify the train and test dataset paths as '/home/../../set'
- Run
python3 VIT_fine_tuned.py
You can follow the exact same process for fine-tuning with pretrained ResNet50
Using Ensemble GAN as described by Hirose et al. here
- Arrange your folder structure as /../../data/class/
- Set the dataroot path '/../../data/'
- Run
python3 GAN_ensemble_train.py
The model saves thre .pth files each corresponding to the models of the ensemble
- Open the script gan_classifier.py
- Specify the saved models to load as
netD.load_state_dict(torch.load('model.pth'))
- Specify the train and test path as '/../../train/' and '/../../test/'
4.Run
python3 gan_classifier.py
Link to the dataset here