File size: 787 Bytes
e81879a
3559626
05c62eb
 
dc4e72f
 
 
 
e81879a
dc4e72f
ba8079a
 
2679436
c7429e9
4f950cb
05c62eb
ba8079a
 
dc4e72f
ba8079a
 
 
 
4ddb435
 
fb887f7
 
dc4e72f
 
 
2dfea56
ad0e7fc
4ddb435
05c62eb
 
 
ad0e7fc
05c62eb
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
32
33
34
35
36
37
38
39
import gradio as gr
import tensorflow as tf
import numpy as np
import os
import tensorflow as tf
import numpy as np
from keras.models import load_model
from tensorflow.keras.utils import load_img

# Charger le modèle

model = load_model('model_cv.h5')



def detect(img):
    img = np.expand_dims(img, axis=0)
    img = img/255
    prediction = model.predict(img)[0]
    if prediction[0] <= 0.80:
        return "Pneumonia  Detected!"

    return "Pneumonia Not Detected!"


# result = detect(img)
# print(result)
os.system("tar -zxvf examples.tar.gz")


input = gr.inputs.Image(shape=(100,100))



title = "PneumoDetect: Pneumonia Detection from Chest X-Rays"

iface = gr.Interface(fn=detect, inputs=input, outputs="text", examples_per_page=20, title=title)
iface.launch(inline=False)