ekenkel commited on
Commit
2814feb
·
1 Parent(s): 2d4e310

updated model with new architecture

Browse files
Files changed (5) hide show
  1. README.md +1 -1
  2. app.py +2 -2
  3. dogIdentifierModel.pkl +2 -2
  4. modelCreation.py +3 -2
  5. requirements.txt +1 -0
README.md CHANGED
@@ -27,5 +27,5 @@ I randomly split the data:
27
  - 80% training set
28
  - 20% validation set
29
 
30
- After resizing the images to be 128 x 128 px, I trained using the ResNet Architecture with 18 layers and 25 epochs.
31
 
 
27
  - 80% training set
28
  - 20% validation set
29
 
30
+ After resizing the images to be 128 x 128 px, I trained using the ConvNeXt-22k convolution neural network and 18 epochs.
31
 
app.py CHANGED
@@ -21,8 +21,8 @@ def classify_image(img):
21
 
22
  learn = load_learner('dogIdentifierModel.pkl')
23
 
24
- image = gr.inputs.Image(shape=(192, 192))
25
- label = gr.outputs.Label()
26
  examples = ['golden-retriever.jpg', 'german-shepherd.jpg', 'pinscher.jpg', 'husky.jpg']
27
 
28
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
 
21
 
22
  learn = load_learner('dogIdentifierModel.pkl')
23
 
24
+ image = gr.components.Image(shape=(192, 192))
25
+ label = gr.components.Label()
26
  examples = ['golden-retriever.jpg', 'german-shepherd.jpg', 'pinscher.jpg', 'husky.jpg']
27
 
28
  intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
dogIdentifierModel.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dd840bc3bb96e8d924b3354539ac89e6f4c953f40476793f62d465eab35c3715
3
- size 47786859
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6fb82faf70b0ba80b519cec9185e50891011be20ff8a7b6bd8de6072d2bc8d1d
3
+ size 115099127
modelCreation.py CHANGED
@@ -7,6 +7,7 @@ import os, shutil
7
  import time
8
  import requests
9
  import json
 
10
  from azure.cognitiveservices.search.imagesearch import ImageSearchClient as api
11
  from msrest.authentication import CognitiveServicesCredentials as auth
12
 
@@ -73,7 +74,7 @@ dataloaders = DataBlock(
73
  ).dataloaders(path)
74
 
75
 
76
- learn = vision_learner(dataloaders, resnet18, metrics=error_rate)
77
- learn.fine_tune(25)
78
 
79
  learn.export('dogIdentifierModel.pkl')
 
7
  import time
8
  import requests
9
  import json
10
+ import timm
11
  from azure.cognitiveservices.search.imagesearch import ImageSearchClient as api
12
  from msrest.authentication import CognitiveServicesCredentials as auth
13
 
 
74
  ).dataloaders(path)
75
 
76
 
77
+ learn = vision_learner(dataloaders, 'convnext_tiny_in22k', metrics=error_rate)
78
+ learn.fine_tune(18)
79
 
80
  learn.export('dogIdentifierModel.pkl')
requirements.txt CHANGED
@@ -3,4 +3,5 @@ torch
3
  gradio
4
  numpy
5
  pandas
 
6
  azure-cognitiveservices-search-imagesearch
 
3
  gradio
4
  numpy
5
  pandas
6
+ timm
7
  azure-cognitiveservices-search-imagesearch