Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import tensorflow as tf
|
3 |
+
import numpy as np
|
4 |
+
from huggingface_hub import from_pretrained_keras
|
5 |
+
|
6 |
+
model = from_pretrained_keras("Hitomiblood/blindness_model_keras")
|
7 |
+
|
8 |
+
def classify_image(image):
|
9 |
+
image = image.resize((512, 512))
|
10 |
+
image_array = np.array(inp) / 255.0 # Normalización
|
11 |
+
prediction = inception_net.predict(inp).flatten()
|
12 |
+
return prediction
|
13 |
+
|
14 |
+
image = gr.inputs.Image(shape=(512, 512))
|
15 |
+
label = gr.outputs.Label(num_top_classes=1)
|
16 |
+
|
17 |
+
gr.Interface(fn=classify_image, inputs=image, outputs=label, capture_session=True, theme = "grass").launch()
|