Spaces:
Running
Running
Xiaolong-Wang
commited on
fix gradio new version
Browse files
app.py
CHANGED
@@ -70,15 +70,15 @@ def KittiBEV():
|
|
70 |
""")
|
71 |
|
72 |
with gr.Row():
|
73 |
-
front_img = gr.Image(label="Front-view Image"
|
74 |
-
BEV_output = gr.Image(label="BEV Image"
|
75 |
|
76 |
fov = gr.Slider(1,90, value=20, label="FOV")
|
77 |
pitch = gr.Slider(-180, 180, value=0, label="Pitch")
|
78 |
scale = gr.Slider(1, 10, value=1.0, label="Scale")
|
79 |
out_size = gr.Slider(500, 1000, value=500, label="Out size")
|
80 |
btn = gr.Button(value="Get BEV Image")
|
81 |
-
btn.click(get_BEV_kitti,inputs= [front_img, fov, pitch, scale, out_size], outputs=BEV_output
|
82 |
gr.Markdown(
|
83 |
"""
|
84 |
### Note:
|
@@ -91,12 +91,14 @@ def KittiBEV():
|
|
91 |
|
92 |
gr.Markdown("## Image Examples")
|
93 |
gr.Examples(
|
94 |
-
examples=[
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
98 |
fn=get_BEV_kitti,
|
99 |
-
cache_examples=
|
100 |
)
|
101 |
demo.launch()
|
102 |
|
|
|
70 |
""")
|
71 |
|
72 |
with gr.Row():
|
73 |
+
front_img = gr.Image(label="Front-view Image", height=450)
|
74 |
+
BEV_output = gr.Image(label="BEV Image", height=450)
|
75 |
|
76 |
fov = gr.Slider(1,90, value=20, label="FOV")
|
77 |
pitch = gr.Slider(-180, 180, value=0, label="Pitch")
|
78 |
scale = gr.Slider(1, 10, value=1.0, label="Scale")
|
79 |
out_size = gr.Slider(500, 1000, value=500, label="Out size")
|
80 |
btn = gr.Button(value="Get BEV Image")
|
81 |
+
btn.click(get_BEV_kitti,inputs= [front_img, fov, pitch, scale, out_size], outputs=BEV_output)
|
82 |
gr.Markdown(
|
83 |
"""
|
84 |
### Note:
|
|
|
91 |
|
92 |
gr.Markdown("## Image Examples")
|
93 |
gr.Examples(
|
94 |
+
examples=[
|
95 |
+
["./figure/exp1.jpg", 27, 7, 6, 1000],
|
96 |
+
["./figure/exp2.png", 17.5, 0.8, 4, 1000]
|
97 |
+
],
|
98 |
+
inputs=[front_img, fov, pitch, scale, out_size],
|
99 |
+
outputs=BEV_output,
|
100 |
fn=get_BEV_kitti,
|
101 |
+
cache_examples=True # 建议启用缓存以提高性能
|
102 |
)
|
103 |
demo.launch()
|
104 |
|