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