Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -270,7 +270,21 @@ with gr.Blocks(title="Solar CME Detection") as demo:
|
|
270 |
|
271 |
# State to store fetched frames
|
272 |
fetched_frames_state = gr.State(value=[])
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
with gr.Row():
|
275 |
with gr.Column():
|
276 |
gr.Markdown("### Input Options")
|
@@ -279,30 +293,16 @@ with gr.Blocks(title="Solar CME Detection") as demo:
|
|
279 |
size = gr.Textbox(label="Image Size", value="1024by960")
|
280 |
tool = gr.Textbox(label="Instrument", value="ccor1")
|
281 |
fetch_button = gr.Button("Fetch Images from URL")
|
282 |
-
|
283 |
-
gr.Markdown("### Analysis Parameters")
|
284 |
-
lower_bound = gr.Slider(minimum=0, maximum=255, value=low_int, step=1, label="Lower Intensity Bound (0-255)")
|
285 |
-
upper_bound = gr.Slider(minimum=0, maximum=255, value=high_int, step=1, label="Upper Intensity Bound (0-255)")
|
286 |
-
param1 = gr.Slider(minimum=10, maximum=200, value=edge_thresh, step=1, label="Hough Param1 (Edge Threshold)")
|
287 |
-
param2 = gr.Slider(minimum=1, maximum=50, value=accum_thresh, step=1, label="Hough Param2 (Accumulator Threshold)")
|
288 |
-
center_tolerance = gr.Slider(minimum=10, maximum=100, value=center_tol, step=1, label="Center Tolerance (Pixels)")
|
289 |
-
morph_iterations = gr.Slider(minimum=1, maximum=5, value=morph_dia, step=1, label="Morphological Dilation Iterations")
|
290 |
-
min_rad = gr.Slider(minimum=1, maximum=100, value=min_rad, step=1, label="Minimum Circle Radius")
|
291 |
-
display_mode = gr.Dropdown(
|
292 |
-
choices=["All Frames", "Detected Frames", "Both (Detected Replaces Original)"],
|
293 |
-
value="Both (Detected Replaces Original)",
|
294 |
-
label="Display Mode"
|
295 |
-
)
|
296 |
-
|
297 |
analyze_button = gr.Button("Analyze")
|
298 |
|
299 |
with gr.Column():
|
300 |
gr.Markdown("### Outputs")
|
301 |
report = gr.Textbox(label="Analysis Report", lines=10)
|
302 |
preview = gr.Gallery(label="Input Preview (All Frames)")
|
303 |
-
gallery = gr.Gallery(label="Frames with Detected Circles (Green: Detected, Orange: Growing Series)")
|
304 |
-
gif_output = gr.File(label="Download Resulting GIF")
|
305 |
total_images = gr.Textbox(label="Total Images Available in Directory", value="0")
|
|
|
|
|
|
|
306 |
|
307 |
# Fetch button action
|
308 |
fetch_button.click(
|
|
|
270 |
|
271 |
# State to store fetched frames
|
272 |
fetched_frames_state = gr.State(value=[])
|
273 |
+
with gr.Sidebar():
|
274 |
+
|
275 |
+
gr.Markdown("### Analysis Parameters")
|
276 |
+
lower_bound = gr.Slider(minimum=0, maximum=255, value=low_int, step=1, label="Lower Intensity Bound (0-255)")
|
277 |
+
upper_bound = gr.Slider(minimum=0, maximum=255, value=high_int, step=1, label="Upper Intensity Bound (0-255)")
|
278 |
+
param1 = gr.Slider(minimum=10, maximum=200, value=edge_thresh, step=1, label="Hough Param1 (Edge Threshold)")
|
279 |
+
param2 = gr.Slider(minimum=1, maximum=50, value=accum_thresh, step=1, label="Hough Param2 (Accumulator Threshold)")
|
280 |
+
center_tolerance = gr.Slider(minimum=10, maximum=100, value=center_tol, step=1, label="Center Tolerance (Pixels)")
|
281 |
+
morph_iterations = gr.Slider(minimum=1, maximum=5, value=morph_dia, step=1, label="Morphological Dilation Iterations")
|
282 |
+
min_rad = gr.Slider(minimum=1, maximum=100, value=min_rad, step=1, label="Minimum Circle Radius")
|
283 |
+
display_mode = gr.Dropdown(
|
284 |
+
choices=["All Frames", "Detected Frames", "Both (Detected Replaces Original)"],
|
285 |
+
value="Both (Detected Replaces Original)",
|
286 |
+
label="Display Mode"
|
287 |
+
)
|
288 |
with gr.Row():
|
289 |
with gr.Column():
|
290 |
gr.Markdown("### Input Options")
|
|
|
293 |
size = gr.Textbox(label="Image Size", value="1024by960")
|
294 |
tool = gr.Textbox(label="Instrument", value="ccor1")
|
295 |
fetch_button = gr.Button("Fetch Images from URL")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
analyze_button = gr.Button("Analyze")
|
297 |
|
298 |
with gr.Column():
|
299 |
gr.Markdown("### Outputs")
|
300 |
report = gr.Textbox(label="Analysis Report", lines=10)
|
301 |
preview = gr.Gallery(label="Input Preview (All Frames)")
|
|
|
|
|
302 |
total_images = gr.Textbox(label="Total Images Available in Directory", value="0")
|
303 |
+
with gr.Row():
|
304 |
+
gallery = gr.Gallery(label="Frames with Detected Circles (Green: Detected, Orange: Growing Series)")
|
305 |
+
gif_output = gr.File(label="Download Resulting GIF")
|
306 |
|
307 |
# Fetch button action
|
308 |
fetch_button.click(
|