A torch dataset for YGO card images.
- Copy
cards.cdb
,strings.conf
,pics/
from YGOPro. - Generate card images.
python make_image.py
from torchvision import transforms
from card_image.dataset import BasicDataset, MonsterDataset
data_transform = transforms.Compose([
transforms.RandomResizedCrop(320, scale=(0.9, 1.0)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5]),
])
dataset = BasicDataset('card_image/im/', item_list=[
'race', 'attribute', 'type', 'category', 'setcode',
], transform=data_transform)
monster_dataset = MonsterDataset('card_image/im/', item_list=[
'race', 'attribute',
], transform=data_transform)