NishantAGI commited on
Commit
00a8495
·
verified ·
1 Parent(s): c72fd58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -16
app.py CHANGED
@@ -136,27 +136,38 @@ def segment_mars(img_path):
136
 
137
  # 3. CUSTOM HTML LEGEND
138
  legend_html = """
139
- <div style="display: flex; justify-content: center; gap: 20px; font-weight: bold; margin-bottom: 10px;">
140
- <div style="display: flex; align-items: center; gap: 5px;">
141
- <div style="width: 20px; height: 20px; background-color: rgb(0, 255, 0); border: 1px solid white;"></div> <span>Soil</span>
142
- </div>
143
- <div style="display: flex; align-items: center; gap: 5px;">
144
- <div style="width: 20px; height: 20px; background-color: rgb(0, 0, 255); border: 1px solid white;"></div> <span>Bedrock</span>
145
- </div>
146
- <div style="display: flex; align-items: center; gap: 5px;">
147
- <div style="width: 20px; height: 20px; background-color: rgb(255, 215, 0); border: 1px solid white;"></div> <span>Sand</span>
148
- </div>
149
- <div style="display: flex; align-items: center; gap: 5px;">
150
- <div style="width: 20px; height: 20px; background-color: rgb(255, 0, 0); border: 1px solid white;"></div> <span>Big Rock</span>
151
- </div>
152
- <div style="display: flex; align-items: center; gap: 5px;">
153
- <div style="width: 20px; height: 20px; background-color: rgb(0, 0, 0); border: 1px solid white;"></div> <span>Rover / Background Mask</span>
 
 
 
 
 
 
 
 
 
 
 
154
  </div>
155
  </div>
156
  """
157
  # 3. GRADIO INTERFACE
158
  with gr.Blocks() as demo:
159
- gr.Markdown(f"## NASA AI4Mars Expert Fused Classifier")
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)