Prachidwi commited on
Commit
b7ea056
1 Parent(s): a188bbd

Create aap.py

Browse files
Files changed (1) hide show
  1. aap.py +10 -0
aap.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ path = untar_data(URLs.PETS)/'images'
3
+ def is_cat(x): return x[0].isupper()
4
+ dls = ImageDataLoaders.from_name_func('.',
5
+ get_image_files(path), valid_pct=0.2, seed=42,
6
+ label_func=is_cat,
7
+ item_tfms=Resize(192))
8
+ learn = vision_learner(dls, resnet18, metrics=error_rate)
9
+ learn.fine_tune(3)
10
+ learn.export('model.pkl')