Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
def alz_mri_classification(image):
|
3 |
classifier = pipeline("image-classification", model="dewifaj/alzheimer_mri_classification")
|
@@ -7,7 +8,12 @@ def alz_mri_classification(image):
|
|
7 |
score = prediction['score']
|
8 |
label = prediction['label']
|
9 |
return {"score": score, "label": label}
|
|
|
10 |
|
11 |
image_input = gr.Image(type="pil", label="Upload Image")
|
12 |
-
iface = gr.Interface(fn=alz_mri_classification,
|
|
|
|
|
|
|
|
|
13 |
iface.launch()
|
|
|
1 |
+
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
def alz_mri_classification(image):
|
4 |
classifier = pipeline("image-classification", model="dewifaj/alzheimer_mri_classification")
|
|
|
8 |
score = prediction['score']
|
9 |
label = prediction['label']
|
10 |
return {"score": score, "label": label}
|
11 |
+
example_image_paths = ["example_image1.jpg", "example_image2.jpg", "example_image3.jpg", "example_image4.jpg"]
|
12 |
|
13 |
image_input = gr.Image(type="pil", label="Upload Image")
|
14 |
+
iface = gr.Interface(fn=alz_mri_classification,
|
15 |
+
inputs=image_input,
|
16 |
+
outputs="json",
|
17 |
+
example = example_image_paths,
|
18 |
+
title="Alzheimer Recognition from MRI")
|
19 |
iface.launch()
|