Update app.py
Browse files
app.py
CHANGED
@@ -11,15 +11,9 @@ head = (
|
|
11 |
)
|
12 |
|
13 |
|
14 |
-
cnn = tf.keras.models.load_model("cnn_model.h5")
|
15 |
-
|
16 |
-
def predict_input_image(img):
|
17 |
-
img = img.reshape(1, 500, 500, 1)
|
18 |
-
prediction = cnn.predict(img).tolist()[0]
|
19 |
-
class_names = ["Covid"]
|
20 |
-
return {class_names[i]: 1-prediction[i] for i in range(1)}
|
21 |
|
22 |
image = gr.inputs.Image(shape=(500, 500), image_mode='L', invert_colors=False, source="upload")
|
23 |
label = gr.outputs.Label()
|
24 |
iface = gr.Interface(fn=predict_input_image, inputs=image, outputs=label,title=title, description=head)
|
25 |
-
|
|
|
|
11 |
)
|
12 |
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
image = gr.inputs.Image(shape=(500, 500), image_mode='L', invert_colors=False, source="upload")
|
16 |
label = gr.outputs.Label()
|
17 |
iface = gr.Interface(fn=predict_input_image, inputs=image, outputs=label,title=title, description=head)
|
18 |
+
|
19 |
+
gr.Interface.load("models/swww/test").launch()
|