For example, you can put image dataset in a folder.
I put it here: E:/Oxford_Flowers17/train
Baidu Yun | |
---|---|
flowers17(kkdc) | flowers17 |
SceneClass13(0onp) | SceneClass13 |
AnimTransDistr(otd5) | AnimTransDistr |
ps: Of course you can define dataloader on your own!
from classifier import classifier
if __name__ == '__main__': # removing this line brings dataloader error, this is because of python's multithread feature
clf = classifier('xception', 17, (200, 200), 'E:/Oxford_Flowers17/train')
clf.train()
It will begin to train a Xception with dataloader with 17 classes, resize image to 200*200, load data from 'E:/Oxford_Flowers17/train'
. Best model will be saved to folder "./saved"
every 2 epoch. To know more about default setting, click here.
from classifier import classifier
if __name__ == '__main__':
clf = classifier('xception', 17, (60, 60), 'E:/Oxford_Flowers17/train')
clf.train_from('E:/ModelFeast/saved/xception/0305_130143/checkpoint_best.pth')
unbelievably simple, right ?!