mahderf commited on
Commit
7d6fdb7
·
1 Parent(s): ff671b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -8,7 +8,7 @@ labels = learn.dls.vocab
8
  def predict(img):
9
  img = PILImage.create(img)
10
  pred,pred_idx,probs = learn.predict(img)
11
- return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
  title = "Calligraphy Classifier"
14
  description = "A calligraphy type classifer was trained with fastai. Please note that this classifier is currnetly limited to Naskh and Nastaligh."
 
8
  def predict(img):
9
  img = PILImage.create(img)
10
  pred,pred_idx,probs = learn.predict(img)
11
+ return dic(zip(categories, map(float,porbs)))
12
 
13
  title = "Calligraphy Classifier"
14
  description = "A calligraphy type classifer was trained with fastai. Please note that this classifier is currnetly limited to Naskh and Nastaligh."