File size: 594 Bytes
6f1b582
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from fastai.vision.all import *

path = untar_data(URLs.PETS)
dls = ImageDataLoaders.from_name_re(path, 
                                    get_image_files(path/'images'), pat='(.+)_\d+.jpg', 
                                    item_tfms=Resize(460), 
                                    batch_tfms=aug_transforms(size=224, min_scale=0.75),
                                    num_workers=0,
                                    bs=16,
                                    )
learn = vision_learner(dls, models.resnet50, metrics=accuracy)
learn.fine_tune(1)
learn.path = Path('.')
learn.export()