Spaces:
Sleeping
Sleeping
cheng
commited on
Commit
·
cc3ccd2
1
Parent(s):
de59cd4
update layout and process
Browse files
app.py
CHANGED
@@ -26,9 +26,9 @@ import groundingdino.datasets.transforms as T
|
|
26 |
|
27 |
from huggingface_hub import hf_hub_download
|
28 |
|
29 |
-
picture_height =
|
30 |
-
picture_width =
|
31 |
-
picture_fov =
|
32 |
|
33 |
# Use this command for evaluate the GLIP-T model
|
34 |
config_file = "groundingdino/config/GroundingDINO_SwinT_OGC.py"
|
@@ -116,16 +116,17 @@ if __name__ == "__main__":
|
|
116 |
detect_app = gr.Blocks()
|
117 |
with detect_app:
|
118 |
gr.Markdown("# Panorama Traffic Sign Detection Demo")
|
|
|
119 |
gr.Markdown("Note the model runs on CPU for demo, so it may take a while to run the model.")
|
120 |
|
121 |
with gr.Row():
|
122 |
with gr.Column():
|
123 |
input_image = gr.Image(source='upload', type="numpy", label="Please upload a panorama picture.")
|
124 |
-
run_button = gr.Button(
|
125 |
with gr.Row():
|
126 |
with gr.Column():
|
127 |
gallery = gr.Gallery(label="Detection Results").style(
|
128 |
-
|
129 |
|
130 |
run_button.click(fn=detection, inputs=[
|
131 |
input_image], outputs=[gallery])
|
|
|
26 |
|
27 |
from huggingface_hub import hf_hub_download
|
28 |
|
29 |
+
picture_height = 480
|
30 |
+
picture_width = 720
|
31 |
+
picture_fov = 45
|
32 |
|
33 |
# Use this command for evaluate the GLIP-T model
|
34 |
config_file = "groundingdino/config/GroundingDINO_SwinT_OGC.py"
|
|
|
116 |
detect_app = gr.Blocks()
|
117 |
with detect_app:
|
118 |
gr.Markdown("# Panorama Traffic Sign Detection Demo")
|
119 |
+
gr.Markdown("Please upload an panorama picture to see the detection results.")
|
120 |
gr.Markdown("Note the model runs on CPU for demo, so it may take a while to run the model.")
|
121 |
|
122 |
with gr.Row():
|
123 |
with gr.Column():
|
124 |
input_image = gr.Image(source='upload', type="numpy", label="Please upload a panorama picture.")
|
125 |
+
run_button = gr.Button(value="Process & Detect", variant="primary")
|
126 |
with gr.Row():
|
127 |
with gr.Column():
|
128 |
gallery = gr.Gallery(label="Detection Results").style(
|
129 |
+
grid=(2, 3), preview=False, object_fit="none")
|
130 |
|
131 |
run_button.click(fn=detection, inputs=[
|
132 |
input_image], outputs=[gallery])
|