Skip to content

Commit 9bd8ccf

Browse files
committed
✨ (app_class.py): redesign UI with improved styling and layout organization
♻️ (app_class.py): restructure settings into tabs instead of accordions for better UX 📝 (app_class.py): update description with GPU acceleration info and better formatting 💡 (app_class.py): move image settings to separate tab and adjust font sizes
1 parent 1f516c9 commit 9bd8ccf

File tree

1 file changed

+46
-38
lines changed

1 file changed

+46
-38
lines changed

imcui/ui/app_class.py

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,29 @@
2020
)
2121

2222
DESCRIPTION = """
23-
# Image Matching WebUI
23+
<div style="text-align: left;">
24+
<h1 style="font-size: 2rem; font-weight: bold; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 1rem;">
25+
Image Matching WebUI
26+
</h1>
27+
</div>
28+
2429
This Space demonstrates [Image Matching WebUI](https://github.com/Vincentqyw/image-matching-webui) by vincent qin. Feel free to play with it, or duplicate to run image matching without a queue!
2530
<br/>
26-
🔎 For more details about supported local features and matchers, please refer to https://github.com/Vincentqyw/image-matching-webui
31+
🚀 **Now GPU-accelerated!** Thanks to HuggingFace's community grant, all algorithms run on GPU for fast, responsive inference.
2732
28-
🚀 All algorithms run on CPU for inference, causing slow speeds and high latency. For faster inference, please download the [source code](https://github.com/Vincentqyw/image-matching-webui) for local deployment.
33+
🔎 For more details about supported local features and matchers, please refer to https://github.com/Vincentqyw/image-matching-webui
2934
3035
🐛 Your feedback is valuable to me. Please do not hesitate to report any bugs [here](https://github.com/Vincentqyw/image-matching-webui/issues).
3136
"""
3237

3338
CSS = """
3439
#warning {background-color: #FFCCCB}
35-
.logs_class textarea {font-size: 12px !important}
40+
.logs_class textarea {font-size: 10px !important}
41+
42+
.gradio-container {
43+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
44+
}
45+
3646
"""
3747

3848

@@ -112,30 +122,7 @@ def init_interface(self):
112122
button_stop = gr.Button(value="Force Stop", variant="stop")
113123

114124
with gr.Accordion("Advanced Setting", open=False):
115-
with gr.Accordion("Image Setting", open=True):
116-
with gr.Row():
117-
image_force_resize_cb = gr.Checkbox(
118-
label="Force Resize",
119-
value=False,
120-
interactive=True,
121-
)
122-
image_setting_height = gr.Slider(
123-
minimum=48,
124-
maximum=2048,
125-
step=16,
126-
label="Image Height",
127-
value=480,
128-
visible=False,
129-
)
130-
image_setting_width = gr.Slider(
131-
minimum=64,
132-
maximum=2048,
133-
step=16,
134-
label="Image Width",
135-
value=640,
136-
visible=False,
137-
)
138-
with gr.Accordion("Matching Setting", open=True):
125+
with gr.Tab("Matching Setting"):
139126
with gr.Row():
140127
match_setting_threshold = gr.Slider(
141128
minimum=0.0,
@@ -160,17 +147,15 @@ def init_interface(self):
160147
label="Keypoint threshold",
161148
value=0.015,
162149
)
163-
detect_line_threshold = ( # noqa: F841
164-
gr.Slider(
165-
minimum=0.1,
166-
maximum=1,
167-
step=0.01,
168-
label="Line threshold",
169-
value=0.2,
170-
)
150+
detect_line_threshold = gr.Slider( # noqa: F841
151+
minimum=0.1,
152+
maximum=1,
153+
step=0.01,
154+
label="Line threshold",
155+
value=0.2,
171156
)
172157

173-
with gr.Accordion("RANSAC Setting", open=True):
158+
with gr.Tab("RANSAC Setting"):
174159
with gr.Row(equal_height=False):
175160
ransac_method = gr.Dropdown(
176161
choices=ransac_zoo.keys(),
@@ -202,13 +187,36 @@ def init_interface(self):
202187
button_ransac = gr.Button(
203188
value="Rerun RANSAC", variant="primary"
204189
)
205-
with gr.Accordion("Geometry Setting", open=False):
190+
with gr.Tab("Geometry Setting"):
206191
with gr.Row(equal_height=False):
207192
choice_geometry_type = gr.Radio(
208193
["Fundamental", "Homography"],
209194
label="Reconstruct Geometry",
210195
value=self.cfg["defaults"]["setting_geometry"],
211196
)
197+
with gr.Tab("Image Setting"):
198+
with gr.Row():
199+
image_force_resize_cb = gr.Checkbox(
200+
label="Force Resize",
201+
value=False,
202+
interactive=True,
203+
)
204+
image_setting_height = gr.Slider(
205+
minimum=48,
206+
maximum=2048,
207+
step=16,
208+
label="Image Height",
209+
value=480,
210+
visible=False,
211+
)
212+
image_setting_width = gr.Slider(
213+
minimum=64,
214+
maximum=2048,
215+
step=16,
216+
label="Image Width",
217+
value=640,
218+
visible=False,
219+
)
212220
# image resize
213221
image_force_resize_cb.select(
214222
fn=self._on_select_force_resize,

0 commit comments

Comments
 (0)