DavidD003 commited on
Commit
43004c0
·
1 Parent(s): 97dfb29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -55,8 +55,13 @@ def predict(img):
55
  gray_img = pil_image.convert('L')#grayscale
56
  pic = np.array(gray_img) #convert to array
57
  inp_img=reduce_image_count(pic)#Reduce image to required input size
58
-
59
- otpt=F.softmax(mdlV2(Tensor(inp_img.view(-1,64))))[0].data
 
 
 
 
 
60
  #pred,pred_idx,probs = learn.predict(img)
61
 
62
  return dict([[labels[i], float(otpt[i])] for i in range(len(labels))]),inp_img
 
55
  gray_img = pil_image.convert('L')#grayscale
56
  pic = np.array(gray_img) #convert to array
57
  inp_img=reduce_image_count(pic)#Reduce image to required input size
58
+ z=Tensor(inp_img)
59
+ y=z.view(-1,64)
60
+ x=mdlV2(y)
61
+ w=F.softmax(x)
62
+ v=w[0]
63
+ u=v.data
64
+ otpt=u
65
  #pred,pred_idx,probs = learn.predict(img)
66
 
67
  return dict([[labels[i], float(otpt[i])] for i in range(len(labels))]),inp_img