Spaces:
Sleeping
Sleeping
Diaa-Zaher
commited on
Commit
·
712e778
1
Parent(s):
7c3435d
add application file
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ model = tf.keras.models.load_model('Covid19_Model.h5')
|
|
16 |
def predict_image(image):
|
17 |
processed_image = process_image(image)
|
18 |
prediction = model.predict(processed_image)
|
19 |
-
predicted_class_index = np.argmax(prediction)
|
20 |
predicted_class_name = class_names[predicted_class_index]
|
21 |
return f"Prediction: {predicted_class_name}"
|
22 |
|
@@ -24,6 +24,8 @@ examples = ['Samples/064.jpeg',
|
|
24 |
'Samples/072.jpeg',
|
25 |
'Samples/076.jpeg']
|
26 |
|
|
|
|
|
27 |
interface = gr.Interface(fn= predict_image,
|
28 |
inputs= gr.Image(type="pil"),
|
29 |
outputs='text',
|
|
|
16 |
def predict_image(image):
|
17 |
processed_image = process_image(image)
|
18 |
prediction = model.predict(processed_image)
|
19 |
+
predicted_class_index = np.argmax(prediction) # ---> [0.23,0.58,0.86]
|
20 |
predicted_class_name = class_names[predicted_class_index]
|
21 |
return f"Prediction: {predicted_class_name}"
|
22 |
|
|
|
24 |
'Samples/072.jpeg',
|
25 |
'Samples/076.jpeg']
|
26 |
|
27 |
+
# Samples\076.jpeg
|
28 |
+
|
29 |
interface = gr.Interface(fn= predict_image,
|
30 |
inputs= gr.Image(type="pil"),
|
31 |
outputs='text',
|