Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,9 +14,10 @@ text = gr.outputs.Textbox()
|
|
| 14 |
def infer(image):
|
| 15 |
cls = np.argmax(model.predict(np.expand_dims(image, axis = 0)[:,:,:,1]))
|
| 16 |
if cls == 9:
|
| 17 |
-
|
| 18 |
else:
|
| 19 |
cls = labels[cls]
|
| 20 |
-
|
|
|
|
| 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()
|
|
|
|
| 14 |
def infer(image):
|
| 15 |
cls = np.argmax(model.predict(np.expand_dims(image, axis = 0)[:,:,:,1]))
|
| 16 |
if cls == 9:
|
| 17 |
+
output = "Death eater detected! π"
|
| 18 |
else:
|
| 19 |
cls = labels[cls]
|
| 20 |
+
output = f"Welcome to {cls}"
|
| 21 |
+
return output
|
| 22 |
|
| 23 |
gr.Interface(infer, inputs=[canvas], outputs=[text], title="Welcome to Hogwarts Sorting Hat!", description="Draw something and let the sorting hat sort you! π© ").launch()
|