Update app.py
Browse files19 unmodified lines2021222324252610 unmodified lines37383940414243444546474819 unmodified linestransforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])# def predict(img):# img = img.convert("RGB")# img = tfm(img)# img = img[np.newaxis, :]10 unmodified lines# # # print(f"Model prediction {pred}, hence Not Santa")# # # print("========================================================")# return {'cat': 0.2, 'dog': 0.8}# gr.Interface(fn=predict, inputs="image", outputs="label").launch()def image_classifier(inp):return {'santa': 0.3, 'not-a-santa': 0.7}demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")demo.launch()19 unmodified lines2021222324252610 unmodified lines3738394041424344454619 unmodified linestransforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])def predict(img):# img = img.convert("RGB")# img = tfm(img)# img = img[np.newaxis, :]10 unmodified lines# # # print(f"Model prediction {pred}, hence Not Santa")# # # print("========================================================")return {'santa': 0.2, 'not-a-santa': 0.8}# gr.Interface(fn=predict, inputs="image", outputs="label").launch()demo = gr.Interface(fn=predict, inputs="image", outputs="label")demo.launch()
app.py+3-5