Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from tensorflow.keras.utils import load_img
|
|
9 |
|
10 |
# Charger le modèle
|
11 |
|
12 |
-
model = load_model('
|
13 |
|
14 |
|
15 |
def format_decimal(value):
|
@@ -20,16 +20,16 @@ def detect(img):
|
|
20 |
img = np.expand_dims(img, axis=0)
|
21 |
img = img/255
|
22 |
prediction = model.predict(img)[0]
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
return "Pneumonia Not Detected!"
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
|
35 |
# result = detect(img)
|
|
|
9 |
|
10 |
# Charger le modèle
|
11 |
|
12 |
+
model = load_model('model_multi.h5')
|
13 |
|
14 |
|
15 |
def format_decimal(value):
|
|
|
20 |
img = np.expand_dims(img, axis=0)
|
21 |
img = img/255
|
22 |
prediction = model.predict(img)[0]
|
23 |
+
# if prediction[0] <= 0.80:
|
24 |
+
# return "Pneumonia Detected!"
|
25 |
+
|
26 |
+
# return "Pneumonia Not Detected!"
|
27 |
+
if format_decimal(prediction[0]) >= "0.5":
|
28 |
+
return "Risque d'infection bactérienne"
|
29 |
+
if format_decimal(prediction[1]) >= "0.5":
|
30 |
+
return "Poumon sain"
|
31 |
+
if format_decimal(prediction[2]) >= "0.5":
|
32 |
+
return "Risque d'infection biologique"
|
33 |
|
34 |
|
35 |
# result = detect(img)
|