Spaces:
Runtime error
Runtime error
sindhoorar
commited on
Commit
•
68bcdf9
1
Parent(s):
e6bd02a
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
-
from gradio import inputs
|
3 |
from tensorflow.keras.models import load_model
|
4 |
from tensorflow.keras.preprocessing import image
|
5 |
import numpy as np
|
6 |
from keras.applications.imagenet_utils import preprocess_input
|
7 |
|
8 |
-
|
9 |
-
# Load the model
|
10 |
model = load_model('dementia.h5')
|
11 |
|
12 |
def classify_image(inp):
|
@@ -15,7 +12,7 @@ def classify_image(inp):
|
|
15 |
prediction = model.predict(inp).flatten()
|
16 |
return {"Dementia not Detected": float(prediction[0]), "Dementia Detected": float(prediction[1])}
|
17 |
|
18 |
-
image = gr.
|
19 |
|
20 |
interface = gr.Interface(
|
21 |
fn=classify_image,
|
@@ -24,4 +21,4 @@ interface = gr.Interface(
|
|
24 |
title="DementAI",
|
25 |
)
|
26 |
|
27 |
-
interface.launch()
|
|
|
1 |
import gradio as gr
|
|
|
2 |
from tensorflow.keras.models import load_model
|
3 |
from tensorflow.keras.preprocessing import image
|
4 |
import numpy as np
|
5 |
from keras.applications.imagenet_utils import preprocess_input
|
6 |
|
|
|
|
|
7 |
model = load_model('dementia.h5')
|
8 |
|
9 |
def classify_image(inp):
|
|
|
12 |
prediction = model.predict(inp).flatten()
|
13 |
return {"Dementia not Detected": float(prediction[0]), "Dementia Detected": float(prediction[1])}
|
14 |
|
15 |
+
image = gr.Image(shape=(224, 224)) # Modify this line
|
16 |
|
17 |
interface = gr.Interface(
|
18 |
fn=classify_image,
|
|
|
21 |
title="DementAI",
|
22 |
)
|
23 |
|
24 |
+
interface.launch()
|