ArpitaShenoy commited on
Commit
1b3be9f
1 Parent(s): fa5eb33

updated o/p format

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,9 +20,9 @@ def classify_images(img):
20
  elif (len(idxs[0]>1)):
21
  prob = sorted(probs, reverse=True)
22
  idxs = torch.where(probs==prob[0])
23
- return learn.dls.vocab[idxs][0]
24
  else:
25
- return learn.dls.vocab[idxs][0]
26
 
27
  image = gr.inputs.Image(shape=(192,192))
28
  label = gr.outputs.Label()
 
20
  elif (len(idxs[0]>1)):
21
  prob = sorted(probs, reverse=True)
22
  idxs = torch.where(probs==prob[0])
23
+ return "cat: "+learn.dls.vocab[idxs][0]+" ; "+"prob: "+str(probs[idxs].item())
24
  else:
25
+ return "cat: "+learn.dls.vocab[idxs][0]+" ; "+"prob: "+str(probs[idxs].item())
26
 
27
  image = gr.inputs.Image(shape=(192,192))
28
  label = gr.outputs.Label()