Update app.py
Browse files24 unmodified lines25262728293031323334353637383940414224 unmodified linesimg = tfm(img)img = img[np.newaxis, :]# with torch.no_grad():pred_prob = model(img)# pred = torch.max(pred_prob,1).indices# pred = pred.item()# if pred == 1:# print(f"Model prediction {pred}, hence Santa")# else:# print(f"Model prediction {pred}, hence Not Santa")# print("========================================================")gr.Interface(predict, inputs="image", outputs="text").launch()24 unmodified lines25262728293031323334353637383940414224 unmodified linesimg = tfm(img)img = img[np.newaxis, :]with torch.no_grad():pred_prob = model(img)# pred = torch.max(pred_prob,1).indices# pred = pred.item()# if pred == 1:# print(f"Model prediction {pred}, hence Santa")# else:# print(f"Model prediction {pred}, hence Not Santa")# print("========================================================")return pred_probgr.Interface(predict, inputs="image", outputs="label").launch()
app.py+5-5