Update app.py
Browse files
app.py
CHANGED
@@ -1,30 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
head = (
|
7 |
-
"<center>"
|
8 |
-
"Upload an X-ray image to check for covid19. The app is for research purposes and not clinically authorized"
|
9 |
-
"</center>"
|
10 |
-
)
|
11 |
-
title = "Covid 19 Prediction App using X-ray Images"
|
12 |
-
|
13 |
-
head = (
|
14 |
-
"<center>"
|
15 |
-
"Upload an X-ray image to check for covid19. The app is for research purposes and not clinically authorized"
|
16 |
-
"</center>"
|
17 |
-
)
|
18 |
-
|
19 |
-
def predict_input_image(img):
|
20 |
-
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
|
21 |
-
|
22 |
-
extractor = AutoFeatureExtractor.from_pretrained("swww/test")
|
23 |
-
|
24 |
-
model = AutoModelForImageClassification.from_pretrained("swww/test")
|
25 |
-
|
26 |
-
|
27 |
-
image = gr.inputs.Image(shape=(500, 500), image_mode='L', invert_colors=False, source="upload")
|
28 |
-
label = gr.outputs.Label()
|
29 |
-
iface = gr.Interface(fn=predict_input_image, inputs=image, outputs=label,title=title, description=head)
|
30 |
-
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
|
4 |
+
gr.Interface.load("models/swww/test").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|