| 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() |