Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,19 +71,20 @@ def predict(image_np):
|
|
71 |
detection_model = load_model()
|
72 |
|
73 |
# Specify paths to example images
|
74 |
-
|
75 |
|
76 |
# Create a list of example inputs and outputs using a for loop
|
77 |
-
example_inputs = [Image.open(
|
78 |
-
example_outputs = [predict(input_image) for input_image in example_inputs]
|
79 |
|
80 |
# Save the example output image
|
81 |
-
example_outputs[0].save("/home/user/app/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 |
)
|
88 |
|
89 |
iface.launch(share=True)
|
|
|
71 |
detection_model = load_model()
|
72 |
|
73 |
# Specify paths to example images
|
74 |
+
sample_images = [["test_1.jpg"]]
|
75 |
|
76 |
# Create a list of example inputs and outputs using a for loop
|
77 |
+
# example_inputs = [Image.open(image) for image in sample_images]
|
78 |
+
# example_outputs = [predict(input_image) for input_image in example_inputs]
|
79 |
|
80 |
# Save the example output image
|
81 |
+
# example_outputs[0].save("/home/user/app/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 = sample_images
|
88 |
)
|
89 |
|
90 |
iface.launch(share=True)
|