Spaces:
Sleeping
Sleeping
updated code
Browse files
app.py
CHANGED
@@ -59,6 +59,7 @@ def view_model(selected_models):
|
|
59 |
"""
|
60 |
return netron_html if netron_html else "<p>No valid models selected for visualization.</p>"
|
61 |
|
|
|
62 |
custom_css = """
|
63 |
.custom-button {
|
64 |
background-color: purple !important;
|
@@ -66,6 +67,10 @@ custom_css = """
|
|
66 |
width: 120px !important;
|
67 |
border-radius: 5px !important;
|
68 |
font-size: 14px !important;
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
|
71 |
.custom-row {
|
@@ -92,8 +97,6 @@ with gr.Blocks(css=custom_css) as interface:
|
|
92 |
<p>With the integration of state-of-the-art YOLO models, you can explore the performance of object detection algorithms on various images.</p>
|
93 |
</div>
|
94 |
""")
|
95 |
-
|
96 |
-
|
97 |
|
98 |
# Default sample
|
99 |
default_sample = "Sample 1"
|
@@ -134,7 +137,6 @@ with gr.Blocks(css=custom_css) as interface:
|
|
134 |
height="auto", # Adjust height automatically based on content
|
135 |
columns=1 ,
|
136 |
object_fit="contain"
|
137 |
-
|
138 |
)
|
139 |
netron_display = gr.HTML(label="Netron Visualization")
|
140 |
|
@@ -144,6 +146,7 @@ with gr.Blocks(css=custom_css) as interface:
|
|
144 |
inputs=sample_selection,
|
145 |
outputs=sample_display,
|
146 |
)
|
|
|
147 |
with gr.Row(elem_classes="custom-row"):
|
148 |
dff_gallery = gr.Gallery(
|
149 |
label="Deep Feature Factorization",
|
@@ -153,7 +156,6 @@ with gr.Blocks(css=custom_css) as interface:
|
|
153 |
height="auto" # Adjust as needed
|
154 |
)
|
155 |
|
156 |
-
|
157 |
# Multi-threaded processing
|
158 |
def run_both(sample_choice, uploaded_image, selected_models):
|
159 |
results = []
|
@@ -190,7 +192,6 @@ with gr.Blocks(css=custom_css) as interface:
|
|
190 |
return [(image1, text)], netron_html, image2
|
191 |
|
192 |
# Run button click
|
193 |
-
|
194 |
run_button.click(
|
195 |
fn=run_both,
|
196 |
inputs=[sample_selection, upload_image, selected_models],
|
|
|
59 |
"""
|
60 |
return netron_html if netron_html else "<p>No valid models selected for visualization.</p>"
|
61 |
|
62 |
+
# CSS to style the Gradio components and HTML content
|
63 |
custom_css = """
|
64 |
.custom-button {
|
65 |
background-color: purple !important;
|
|
|
67 |
width: 120px !important;
|
68 |
border-radius: 5px !important;
|
69 |
font-size: 14px !important;
|
70 |
+
display: inline-block !important;
|
71 |
+
padding: 10px 20px !important;
|
72 |
+
text-align: center !important;
|
73 |
+
cursor: pointer !important;
|
74 |
}
|
75 |
|
76 |
.custom-row {
|
|
|
97 |
<p>With the integration of state-of-the-art YOLO models, you can explore the performance of object detection algorithms on various images.</p>
|
98 |
</div>
|
99 |
""")
|
|
|
|
|
100 |
|
101 |
# Default sample
|
102 |
default_sample = "Sample 1"
|
|
|
137 |
height="auto", # Adjust height automatically based on content
|
138 |
columns=1 ,
|
139 |
object_fit="contain"
|
|
|
140 |
)
|
141 |
netron_display = gr.HTML(label="Netron Visualization")
|
142 |
|
|
|
146 |
inputs=sample_selection,
|
147 |
outputs=sample_display,
|
148 |
)
|
149 |
+
|
150 |
with gr.Row(elem_classes="custom-row"):
|
151 |
dff_gallery = gr.Gallery(
|
152 |
label="Deep Feature Factorization",
|
|
|
156 |
height="auto" # Adjust as needed
|
157 |
)
|
158 |
|
|
|
159 |
# Multi-threaded processing
|
160 |
def run_both(sample_choice, uploaded_image, selected_models):
|
161 |
results = []
|
|
|
192 |
return [(image1, text)], netron_html, image2
|
193 |
|
194 |
# Run button click
|
|
|
195 |
run_button.click(
|
196 |
fn=run_both,
|
197 |
inputs=[sample_selection, upload_image, selected_models],
|