broadfield-dev commited on
Commit
6ccd679
·
verified ·
1 Parent(s): 4020008

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -58,7 +58,7 @@ def detect_circles(frame_diff, image_center, center_tolerance, param1, param2, m
58
  return filtered_circles if filtered_circles else None
59
  return None
60
 
61
- def analyze_gif(gif_file, lower_bound, upper_bound, param1, param2, center_tolerance, morph_iterations):
62
  """Analyze a GIF for concentric circles, highlighting growing series."""
63
  try:
64
  # Handle Gradio file input
@@ -78,7 +78,7 @@ def analyze_gif(gif_file, lower_bound, upper_bound, param1, param2, center_toler
78
 
79
  # Initialize results
80
  all_circle_data = [] # Store all detected circles
81
- min_radius = 20
82
  max_radius = min(height, width) // 2 # Limit max radius to half the image size
83
 
84
  # Process frames and detect circles
@@ -173,7 +173,8 @@ iface = gr.Interface(
173
  gr.Slider(minimum=10, maximum=200, value=80, step=1, label="Hough Param1 (Edge Threshold)"),
174
  gr.Slider(minimum=1, maximum=50, value=15, step=1, label="Hough Param2 (Accumulator Threshold)"),
175
  gr.Slider(minimum=10, maximum=100, value=30, step=1, label="Center Tolerance (Pixels)"),
176
- gr.Slider(minimum=1, maximum=5, value=2, step=1, label="Morphological Dilation Iterations")
 
177
  ],
178
  outputs=[
179
  gr.Textbox(label="Analysis Report"),
 
58
  return filtered_circles if filtered_circles else None
59
  return None
60
 
61
+ def analyze_gif(gif_file, lower_bound, upper_bound, param1, param2, center_tolerance, morph_iterations, min_rad):
62
  """Analyze a GIF for concentric circles, highlighting growing series."""
63
  try:
64
  # Handle Gradio file input
 
78
 
79
  # Initialize results
80
  all_circle_data = [] # Store all detected circles
81
+ min_radius = int(min_rad)
82
  max_radius = min(height, width) // 2 # Limit max radius to half the image size
83
 
84
  # Process frames and detect circles
 
173
  gr.Slider(minimum=10, maximum=200, value=80, step=1, label="Hough Param1 (Edge Threshold)"),
174
  gr.Slider(minimum=1, maximum=50, value=15, step=1, label="Hough Param2 (Accumulator Threshold)"),
175
  gr.Slider(minimum=10, maximum=100, value=30, step=1, label="Center Tolerance (Pixels)"),
176
+ gr.Slider(minimum=1, maximum=5, value=2, step=1, label="Morphological Dilation Iterations"),
177
+ gr.Slider(minimum=1, maximum=100, value=30, step=1, label="Minimum Circle Radius")
178
  ],
179
  outputs=[
180
  gr.Textbox(label="Analysis Report"),