Prachidwi commited on
Commit
c72a930
·
verified ·
1 Parent(s): 7819b6c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import timm
3
+ path = untar_data(URLs.PETS)/'images'
4
+
5
+ dls = ImageDataLoaders.from_name_func('.',
6
+ get_image_files(path), valid_pct=0.2, seed=42,
7
+ label_func=RegexLabeller(pat = r'^([^/]+)_\d+'),
8
+ item_tfms=Resize(224))
9
+ dls.show_batch(max_n=4)
10
+ learn = vision_learner(dls, resnet34, metrics=error_rate)
11
+ learn.fine_tune(3)
12
+ timm.list_models('convnext*')
13
+ learn = vision_learner(dls, 'convnext_tiny_in22k', metrics=error_rate).to_fp16()
14
+ learn.fine_tune(3)
15
+ learn.export('model.pkl')