Fahimeh Orvati Nia commited on
Commit
1bf989c
·
1 Parent(s): f8ac29e

update the morphology size to plant morphology

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. sorghum_pipeline/output/manager.py +3 -3
app.py CHANGED
@@ -142,7 +142,7 @@ with gr.Blocks() as demo:
142
 
143
  # Row 5: morphology size (YOLO removed)
144
  with gr.Row():
145
- size_img = gr.Image(type="pil", label="Morphology Size", interactive=False)
146
 
147
  # Final: statistics table
148
  stats = gr.Textbox(label="Statistics", lines=4)
 
142
 
143
  # Row 5: morphology size (YOLO removed)
144
  with gr.Row():
145
+ size_img = gr.Image(type="pil", label="Plant Morphology", interactive=False)
146
 
147
  # Final: statistics table
148
  stats = gr.Textbox(label="Statistics", lines=4)
sorghum_pipeline/output/manager.py CHANGED
@@ -233,13 +233,13 @@ class OutputManager:
233
  except Exception as e:
234
  logger.error(f"Failed to save texture: {e}")
235
 
236
- # 9. Morphology size analysis
237
  try:
238
  morph = plant_data.get('morphology_features', {})
239
  images = morph.get('images', {})
240
  size_img = images.get('size_analysis')
241
  if isinstance(size_img, np.ndarray) and size_img.size > 0:
242
- titled = self._add_title_banner(size_img, 'Morphology Size')
243
  cv2.imwrite(str(results_dir / 'size.size_analysis.png'), titled)
244
  else:
245
  # Fallback: synthesize a simple size analysis from the mask if available
@@ -247,7 +247,7 @@ class OutputManager:
247
  base_img_for_size = plant_data.get('composite')
248
  if isinstance(mask_for_size, np.ndarray) and mask_for_size.size > 0:
249
  synthesized = self._create_size_analysis_from_mask(mask_for_size, base_img_for_size)
250
- titled = self._add_title_banner(synthesized, 'Morphology Size')
251
  cv2.imwrite(str(results_dir / 'size.size_analysis.png'), titled)
252
 
253
  # YOLO disabled for speed - skip saving yolo_tips.png
 
233
  except Exception as e:
234
  logger.error(f"Failed to save texture: {e}")
235
 
236
+ # 9. Plant Morphology analysis
237
  try:
238
  morph = plant_data.get('morphology_features', {})
239
  images = morph.get('images', {})
240
  size_img = images.get('size_analysis')
241
  if isinstance(size_img, np.ndarray) and size_img.size > 0:
242
+ titled = self._add_title_banner(size_img, 'Plant Morphology')
243
  cv2.imwrite(str(results_dir / 'size.size_analysis.png'), titled)
244
  else:
245
  # Fallback: synthesize a simple size analysis from the mask if available
 
247
  base_img_for_size = plant_data.get('composite')
248
  if isinstance(mask_for_size, np.ndarray) and mask_for_size.size > 0:
249
  synthesized = self._create_size_analysis_from_mask(mask_for_size, base_img_for_size)
250
+ titled = self._add_title_banner(synthesized, 'Plant Morphology')
251
  cv2.imwrite(str(results_dir / 'size.size_analysis.png'), titled)
252
 
253
  # YOLO disabled for speed - skip saving yolo_tips.png