Spaces:
Build error
Build error
Anthony-Ml
commited on
Commit
•
35b4e55
1
Parent(s):
24c6ba5
Delete app.py
Browse files
app.py
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from fastai.vision.all import *
|
3 |
-
import skimage
|
4 |
-
|
5 |
-
learn = load_learner('predictcovidfastaifinal18102023.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 |
-
interpretation='default'
|
17 |
-
enable_queue=True
|
18 |
-
|
19 |
-
gr.Interface(fn=predict_image, inputs=gr.Image(shape=(224,224)),
|
20 |
-
outputs = gr.Label(num_top_classes=3),title=title,description=description,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch(share=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|