Spaces:
Running
on
Zero
Running
on
Zero
Update ui/app_class.py
Browse files- ui/app_class.py +6 -12
ui/app_class.py
CHANGED
@@ -28,7 +28,6 @@ DESCRIPTION = """
|
|
28 |
MINIMA: Modality Invariant Image Matching
|
29 |
</h1>
|
30 |
</div>
|
31 |
-
|
32 |
<div style="display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px;">
|
33 |
<div>
|
34 |
<a href="https://github.com/LSXI7/MINIMA"><img src="https://img.shields.io/badge/Source_Code-black?logo=Github" alt="Github Source Code"></a>
|
@@ -37,15 +36,12 @@ DESCRIPTION = """
|
|
37 |
<a href="https://arxiv.org/abs/0.0"><img src="https://img.shields.io/badge/arXiv-PDF-b31b1b" alt="arXiv"></a>
|
38 |
</div>
|
39 |
</div>
|
40 |
-
|
41 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
42 |
This Space is derived from <a href="https://github.com/Vincentqyw/image-matching-webui" style="color: #007BFF;">Image Matching WebUI</a>.
|
43 |
</p>
|
44 |
-
|
45 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
46 |
We are grateful to the authors for their contribution of the source code.
|
47 |
</p>
|
48 |
-
|
49 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
50 |
Here we provide our MINIMA-model in our paper for test and comparison, and this project is undergoing continuous enhancement.
|
51 |
</p>
|
@@ -60,9 +56,9 @@ body {
|
|
60 |
padding: 0;
|
61 |
}
|
62 |
#logo-img {
|
63 |
-
width:
|
64 |
height: auto;
|
65 |
-
margin:
|
66 |
display: block;
|
67 |
}
|
68 |
h1 {
|
@@ -84,6 +80,7 @@ a:hover {
|
|
84 |
"""
|
85 |
|
86 |
|
|
|
87 |
class ImageMatchingApp:
|
88 |
def __init__(self, server_name="0.0.0.0", server_port=7860, **kwargs):
|
89 |
self.server_name = server_name
|
@@ -108,7 +105,7 @@ class ImageMatchingApp:
|
|
108 |
with gr.Blocks(css=CSS) as self.app:
|
109 |
with gr.Tab("Image Matching"):
|
110 |
with gr.Row():
|
111 |
-
with gr.Column(scale=1):
|
112 |
gr.Image(
|
113 |
str(
|
114 |
Path(__file__).parent.parent
|
@@ -119,14 +116,14 @@ class ImageMatchingApp:
|
|
119 |
show_share_button=False,
|
120 |
show_download_button=False,
|
121 |
)
|
122 |
-
with gr.Column(scale=
|
123 |
gr.HTML(DESCRIPTION)
|
124 |
with gr.Row(equal_height=False):
|
125 |
with gr.Column():
|
126 |
with gr.Row():
|
127 |
matcher_list = gr.Dropdown(
|
128 |
choices=self.init_matcher_dropdown(),
|
129 |
-
value="superpoint
|
130 |
label="Matching Model",
|
131 |
interactive=True,
|
132 |
)
|
@@ -493,10 +490,8 @@ class ImageMatchingApp:
|
|
493 |
def ui_change_imagebox(self, choice):
|
494 |
"""
|
495 |
Updates the image box with the given choice.
|
496 |
-
|
497 |
Args:
|
498 |
choice (list): The list of image sources to be displayed in the image box.
|
499 |
-
|
500 |
Returns:
|
501 |
dict: A dictionary containing the updated value, sources, and type for the image box.
|
502 |
"""
|
@@ -546,7 +541,6 @@ class ImageMatchingApp:
|
|
546 |
]:
|
547 |
"""
|
548 |
Reset the state of the UI.
|
549 |
-
|
550 |
Returns:
|
551 |
tuple: A tuple containing the initial values for the UI state.
|
552 |
"""
|
|
|
28 |
MINIMA: Modality Invariant Image Matching
|
29 |
</h1>
|
30 |
</div>
|
|
|
31 |
<div style="display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px;">
|
32 |
<div>
|
33 |
<a href="https://github.com/LSXI7/MINIMA"><img src="https://img.shields.io/badge/Source_Code-black?logo=Github" alt="Github Source Code"></a>
|
|
|
36 |
<a href="https://arxiv.org/abs/0.0"><img src="https://img.shields.io/badge/arXiv-PDF-b31b1b" alt="arXiv"></a>
|
37 |
</div>
|
38 |
</div>
|
|
|
39 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
40 |
This Space is derived from <a href="https://github.com/Vincentqyw/image-matching-webui" style="color: #007BFF;">Image Matching WebUI</a>.
|
41 |
</p>
|
|
|
42 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
43 |
We are grateful to the authors for their contribution of the source code.
|
44 |
</p>
|
|
|
45 |
<p style="text-align: center; font-size: 16px; color: #666;">
|
46 |
Here we provide our MINIMA-model in our paper for test and comparison, and this project is undergoing continuous enhancement.
|
47 |
</p>
|
|
|
56 |
padding: 0;
|
57 |
}
|
58 |
#logo-img {
|
59 |
+
width: 220px;
|
60 |
height: auto;
|
61 |
+
margin: 0;
|
62 |
display: block;
|
63 |
}
|
64 |
h1 {
|
|
|
80 |
"""
|
81 |
|
82 |
|
83 |
+
|
84 |
class ImageMatchingApp:
|
85 |
def __init__(self, server_name="0.0.0.0", server_port=7860, **kwargs):
|
86 |
self.server_name = server_name
|
|
|
105 |
with gr.Blocks(css=CSS) as self.app:
|
106 |
with gr.Tab("Image Matching"):
|
107 |
with gr.Row():
|
108 |
+
with gr.Column(scale=1, min_width=150):
|
109 |
gr.Image(
|
110 |
str(
|
111 |
Path(__file__).parent.parent
|
|
|
116 |
show_share_button=False,
|
117 |
show_download_button=False,
|
118 |
)
|
119 |
+
with gr.Column(scale=6, min_width=300):
|
120 |
gr.HTML(DESCRIPTION)
|
121 |
with gr.Row(equal_height=False):
|
122 |
with gr.Column():
|
123 |
with gr.Row():
|
124 |
matcher_list = gr.Dropdown(
|
125 |
choices=self.init_matcher_dropdown(),
|
126 |
+
value="superpoint+minima(lightglue)",
|
127 |
label="Matching Model",
|
128 |
interactive=True,
|
129 |
)
|
|
|
490 |
def ui_change_imagebox(self, choice):
|
491 |
"""
|
492 |
Updates the image box with the given choice.
|
|
|
493 |
Args:
|
494 |
choice (list): The list of image sources to be displayed in the image box.
|
|
|
495 |
Returns:
|
496 |
dict: A dictionary containing the updated value, sources, and type for the image box.
|
497 |
"""
|
|
|
541 |
]:
|
542 |
"""
|
543 |
Reset the state of the UI.
|
|
|
544 |
Returns:
|
545 |
tuple: A tuple containing the initial values for the UI state.
|
546 |
"""
|