Spaces:
Runtime error
Runtime error
Update testegradio.py
Browse files- testegradio.py +3 -3
testegradio.py
CHANGED
@@ -12,7 +12,7 @@ def predict_pneumonia(img):
|
|
12 |
img = np.asarray(img)
|
13 |
img = img.reshape((1,36,36,1))
|
14 |
img = img / 255.0
|
15 |
-
model = load_model("
|
16 |
pred_probs = model.predict(img)[0]
|
17 |
pred_class = np.argmax(pred_probs)
|
18 |
pred_prob = pred_probs[pred_class]
|
@@ -29,7 +29,7 @@ def predict_malaria(img):
|
|
29 |
img = np.asarray(img)
|
30 |
img = img.reshape((1,36,36,3))
|
31 |
img = img.astype(np.float64)
|
32 |
-
model = load_model("
|
33 |
pred_probs = model.predict(img)[0]
|
34 |
pred_class = np.argmax(pred_probs)
|
35 |
pred_prob = pred_probs[pred_class]
|
@@ -39,7 +39,7 @@ def predict_malaria(img):
|
|
39 |
pred_label = "Não está infectado"
|
40 |
return pred_label, pred_prob
|
41 |
|
42 |
-
with open('
|
43 |
diabetes_model = pickle.load(file)
|
44 |
|
45 |
# Função de previsão de diabetes
|
|
|
12 |
img = np.asarray(img)
|
13 |
img = img.reshape((1,36,36,1))
|
14 |
img = img / 255.0
|
15 |
+
model = load_model("pneumonia.h5")
|
16 |
pred_probs = model.predict(img)[0]
|
17 |
pred_class = np.argmax(pred_probs)
|
18 |
pred_prob = pred_probs[pred_class]
|
|
|
29 |
img = np.asarray(img)
|
30 |
img = img.reshape((1,36,36,3))
|
31 |
img = img.astype(np.float64)
|
32 |
+
model = load_model("malaria.h5")
|
33 |
pred_probs = model.predict(img)[0]
|
34 |
pred_class = np.argmax(pred_probs)
|
35 |
pred_prob = pred_probs[pred_class]
|
|
|
39 |
pred_label = "Não está infectado"
|
40 |
return pred_label, pred_prob
|
41 |
|
42 |
+
with open('diabetes_model.sav', 'rb') as file:
|
43 |
diabetes_model = pickle.load(file)
|
44 |
|
45 |
# Função de previsão de diabetes
|