toheedakhtar commited on
Commit
b937508
·
1 Parent(s): 5a3f9c7

working good now

Browse files
Files changed (2) hide show
  1. app.py +7 -9
  2. model.pkl → mommodel.pkl +2 -2
app.py CHANGED
@@ -9,21 +9,19 @@ def label_func(x):
9
  else:
10
  return 'Mogged'
11
 
12
- learn = load_learner('model.pkl')
13
 
14
- # categories = {'Mogger', 'Mogged'}
15
 
16
  def classify_img(image):
17
- what, _t , _ = learn.predict(image)
18
- return what
19
- # pred, idx, probs = learn.predict(image)
20
- # return dict(zip(categories, map(float, probs)))
21
 
22
- image = gr.Image()
23
  label = gr.Label()
24
  examples = ['001.jpg', '002.jpg', '007.jpg', '008.jpg']
25
 
26
-
27
-
28
  intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
29
  intf.launch(inline=False)
 
9
  else:
10
  return 'Mogged'
11
 
12
+ learn = load_learner('mommodel.pkl')
13
 
14
+ categories = {'Mogger', 'Mogged'}
15
 
16
  def classify_img(image):
17
+ # what, _t , _ = learn.predict(image)
18
+ # return what
19
+ pred, idx, probs = learn.predict(image)
20
+ return dict(zip(categories, map(float, probs)))
21
 
22
+ image = gr.Image(shape=(224,224))
23
  label = gr.Label()
24
  examples = ['001.jpg', '002.jpg', '007.jpg', '008.jpg']
25
 
 
 
26
  intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
27
  intf.launch(inline=False)
model.pkl → mommodel.pkl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:429bd2f8638d8357a4098a31cc571a98dc777c35f0db367c597ff262d5ee3436
3
- size 179162534
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:830f8b69a882cf030ae81d67e45cf66ab7040a4e0a79fc7b4aa5fe6d1d665704
3
+ size 46962605