merve HF Staff commited on
Commit
61b77d9
Β·
1 Parent(s): 96d6848

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -15,7 +15,8 @@ def infer(image):
15
  cls = np.argmax(model.predict(np.expand_dims(image, axis = 0)[:,:,:,1]))
16
  if cls == 9:
17
  return "Death eater detected! πŸ’€"
18
- cls = labels[cls]
19
- return f"Welcome to {cls}"
 
20
 
21
  gr.Interface(infer, inputs=[canvas], outputs=[text], title="Welcome to Hogwarts Sorting Hat!", description="Draw something and let the sorting hat sort you! 🎩 ").launch()
 
15
  cls = np.argmax(model.predict(np.expand_dims(image, axis = 0)[:,:,:,1]))
16
  if cls == 9:
17
  return "Death eater detected! πŸ’€"
18
+ else:
19
+ cls = labels[cls]
20
+ return f"Welcome to {cls}"
21
 
22
  gr.Interface(infer, inputs=[canvas], outputs=[text], title="Welcome to Hogwarts Sorting Hat!", description="Draw something and let the sorting hat sort you! 🎩 ").launch()