Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
def image_classifier(inp):
|
4 |
+
confidence_scores = np.random.rand(3)
|
5 |
+
confidence_scores /= np.sum(confidence_scores)
|
6 |
+
classes = ['King', 'Knight', 'Queen']
|
7 |
+
result = {classes[i] : confidence_scores[i] for i in range(3)}
|
8 |
+
return result
|
9 |
+
|
10 |
+
import gradio as gr
|
11 |
+
|
12 |
+
demo = gr.Interface(fn = image_classifier, inputs="image", outputs="label")
|
13 |
+
demo.launch()
|