Anthony-Ml commited on
Commit
92aa748
·
1 Parent(s): 591023e

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +22 -0
  2. covid_1038.png +0 -0
  3. requirements.txt +16 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
+
5
+ learn = load_learner('final_18102023_eb7_model.pkl')
6
+
7
+ categories = learn.dls.vocab
8
+
9
+ def predict_image(get_image):
10
+ pred, idx, probs = learn.predict(get_image)
11
+ return dict(zip(categories, map(float, probs)))
12
+
13
+ title = "Detect COVID_19 Infection Xray Chest Images"
14
+ description = "A covid19 infection classifier trained on the anasmohammedtahir/covidqu dataset with fastai. Created demo using Gradio and HuggingFace Spaces."
15
+ examples = ['/content/dataset/val/normal/Normal (10001).png']
16
+ https://www.kaggle.com/datasets/anasmohammedtahir/covidqu/data
17
+ article="<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>COVID-QU-Ex Dataset</a></p>"
18
+ interpretation='default'
19
+ enable_queue=True
20
+
21
+ gr.Interface(fn=predict_image, inputs=gr.Image(shape=(224,224)),
22
+ outputs = gr.Label(num_top_classes=3),title=title,description=description,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch(share=False)
covid_1038.png ADDED
requirements.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ numpy
2
+ pandas
3
+ os.path
4
+ matplotlib.pyplot
5
+ tensorflow
6
+ seaborn
7
+ os
8
+ shutil
9
+ sys
10
+ tensorflow.keras
11
+ fastai
12
+ torch
13
+ timm
14
+ streamlit
15
+ pickle5
16
+ gradio