Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,13 +12,7 @@ def image_classifier(inp):
|
|
12 |
result = {classes[i]: confidence_scores[i] for i in range(4)}
|
13 |
return result
|
14 |
|
15 |
-
import
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
confidence_scores = np.random. rand(4)
|
20 |
-
confidence_scores /= np.sum(confidence_scores)
|
21 |
-
classes = ['Avocado', 'Banana', 'Guava', 'Mango']
|
22 |
-
result = {classes[i]: confidence_scores[i] for i in range(4)}
|
23 |
-
return result
|
24 |
-
|
|
|
12 |
result = {classes[i]: confidence_scores[i] for i in range(4)}
|
13 |
return result
|
14 |
|
15 |
+
import gradio as gr
|
16 |
+
# Creating Gradio interface
|
17 |
+
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
18 |
+
demo. launch()
|
|
|
|
|
|
|
|
|
|
|
|