Update app.py
Browse files
app.py
CHANGED
@@ -70,12 +70,6 @@ def predict2(pilimg):
|
|
70 |
|
71 |
detection_model = load_model()
|
72 |
|
73 |
-
iface = gr.Interface(fn=predict,
|
74 |
-
inputs=gr.Image(label='Upload an expressway image', type="pil"),
|
75 |
-
outputs=gr.Image(type="pil"),
|
76 |
-
title='Blue and Yellow Taxi detection in live expressway traffic conditions (data.gov.sg)'
|
77 |
-
)
|
78 |
-
|
79 |
# Specify paths to example images
|
80 |
example_image_paths = ["test_1.jpg"]
|
81 |
|
@@ -86,7 +80,9 @@ example_outputs = [predict2(input_image) for input_image in example_image_paths]
|
|
86 |
# Save the example output image
|
87 |
example_outputs[0].save("predicted_1.jpg")
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
70 |
|
71 |
detection_model = load_model()
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
# Specify paths to example images
|
74 |
example_image_paths = ["test_1.jpg"]
|
75 |
|
|
|
80 |
# Save the example output image
|
81 |
example_outputs[0].save("predicted_1.jpg")
|
82 |
|
83 |
+
iface = gr.Interface(fn=predict,
|
84 |
+
inputs=gr.Image(label='Upload an expressway image', type="pil"),
|
85 |
+
outputs=gr.Image(type="pil"),
|
86 |
+
title='Blue and Yellow Taxi detection in live expressway traffic conditions (data.gov.sg)',
|
87 |
+
examples = [[Image.open("test_1.jpg"), Image.open("predicted_1.jpg")]]
|
88 |
+
)
|