Commit
·
e64d82e
1
Parent(s):
1060827
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!pip install -Uqq fastbook
|
2 |
+
!pip install fastai==2.5
|
3 |
+
import fastbook
|
4 |
+
fastbook.setup_book()
|
5 |
+
|
6 |
+
from fastbook import *
|
7 |
+
from fastai.vision.widgets import *
|
8 |
+
|
9 |
+
path = Path('/content/gdrive/My Drive/caballos')
|
10 |
+
|
11 |
+
modelo = DataBlock(
|
12 |
+
blocks=(ImageBlock, CategoryBlock),
|
13 |
+
get_items=get_image_files,
|
14 |
+
splitter=RandomSplitter(valid_pct=0.2, seed=42),
|
15 |
+
get_y=parent_label,
|
16 |
+
item_tfms=RandomResizedCrop(224, min_scale=0.5),
|
17 |
+
batch_tfms=aug_transforms())
|
18 |
+
|
19 |
+
dls = modelo.dataloaders(path)
|
20 |
+
|
21 |
+
learn = cnn_learner(dls, resnet18, metrics=error_rate)
|
22 |
+
learn.fine_tune(4)
|