Update app.py
Browse files
app.py
CHANGED
|
@@ -136,27 +136,38 @@ def segment_mars(img_path):
|
|
| 136 |
|
| 137 |
# 3. CUSTOM HTML LEGEND
|
| 138 |
legend_html = """
|
| 139 |
-
<div style="
|
| 140 |
-
<
|
| 141 |
-
|
| 142 |
-
</
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
<div style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
</div>
|
| 155 |
</div>
|
| 156 |
"""
|
| 157 |
# 3. GRADIO INTERFACE
|
| 158 |
with gr.Blocks() as demo:
|
| 159 |
-
gr.Markdown(f"## NASA
|
| 160 |
gr.HTML(legend_html)
|
| 161 |
with gr.Row():
|
| 162 |
img_input = gr.Image(type="filepath", label="Input Martian Image",interactive=False)
|
|
|
|
| 136 |
|
| 137 |
# 3. CUSTOM HTML LEGEND
|
| 138 |
legend_html = """
|
| 139 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
| 140 |
+
<p style="font-size: 1.2em; font-weight: bold; margin-bottom: 15px;">
|
| 141 |
+
🔍 Select an image to segment from the examples below
|
| 142 |
+
</p>
|
| 143 |
+
|
| 144 |
+
<div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; font-weight: bold;">
|
| 145 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 146 |
+
<div style="width: 18px; height: 18px; background-color: rgb(0, 255, 0); border: 1px solid #ccc; border-radius: 3px;"></div>
|
| 147 |
+
<span>Soil</span>
|
| 148 |
+
</div>
|
| 149 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 150 |
+
<div style="width: 18px; height: 18px; background-color: rgb(0, 0, 255); border: 1px solid #ccc; border-radius: 3px;"></div>
|
| 151 |
+
<span>Bedrock</span>
|
| 152 |
+
</div>
|
| 153 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 154 |
+
<div style="width: 18px; height: 18px; background-color: rgb(255, 215, 0); border: 1px solid #ccc; border-radius: 3px;"></div>
|
| 155 |
+
<span>Sand</span>
|
| 156 |
+
</div>
|
| 157 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 158 |
+
<div style="width: 18px; height: 18px; background-color: rgb(255, 0, 0); border: 1px solid #ccc; border-radius: 3px;"></div>
|
| 159 |
+
<span>Big Rock</span>
|
| 160 |
+
</div>
|
| 161 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 162 |
+
<div style="width: 18px; height: 18px; background-color: rgb(0, 0, 0); border: 1px solid #ccc; border-radius: 3px;"></div>
|
| 163 |
+
<span>Rover/Background</span>
|
| 164 |
+
</div>
|
| 165 |
</div>
|
| 166 |
</div>
|
| 167 |
"""
|
| 168 |
# 3. GRADIO INTERFACE
|
| 169 |
with gr.Blocks() as demo:
|
| 170 |
+
gr.Markdown(f"## NASA Curiosity Rover Terrain Classifier")
|
| 171 |
gr.HTML(legend_html)
|
| 172 |
with gr.Row():
|
| 173 |
img_input = gr.Image(type="filepath", label="Input Martian Image",interactive=False)
|