rcrane4 commited on
Commit
9a80102
Β·
verified Β·
1 Parent(s): 04b86f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -3
app.py CHANGED
@@ -82,10 +82,8 @@ def run_pipeline(image: np.ndarray, subset: str) -> tuple:
82
  arr_model = (arr_model - mean) / std
83
  img_tensor = torch.from_numpy(arr_model).permute(2, 0, 1).float()
84
 
85
- print(f"DEBUG display_arr: min={display_arr.min()} max={display_arr.max()}")
86
  # ── Step 2: Segment ───────────────────────────────────────────────────────
87
  mask = predict_mask(model, img_tensor, IMAGE_SIZE)
88
- print(f"DEBUG mask: unique={np.unique(mask).tolist()} defect_px={( mask==1).sum()}")
89
 
90
  # ── Step 3: Extract features ──────────────────────────────────────────────
91
  features = extract_features(mask, IMAGE_SIZE)
@@ -150,7 +148,6 @@ def run_pipeline(image: np.ndarray, subset: str) -> tuple:
150
  # Ensure output is exactly what Gradio expects
151
  overlay = overlay.astype(np.uint8)
152
  assert overlay.ndim == 3 and overlay.shape[2] == 3
153
- print(f"DEBUG overlay: shape={overlay.shape} dtype={overlay.dtype} min={overlay.min()} max={overlay.max()}")
154
  return overlay, features_text, diagnosis_text, risk_label
155
  # ── Gradio UI ─────────────────────────────────────────────────────────────────
156
 
 
82
  arr_model = (arr_model - mean) / std
83
  img_tensor = torch.from_numpy(arr_model).permute(2, 0, 1).float()
84
 
 
85
  # ── Step 2: Segment ───────────────────────────────────────────────────────
86
  mask = predict_mask(model, img_tensor, IMAGE_SIZE)
 
87
 
88
  # ── Step 3: Extract features ──────────────────────────────────────────────
89
  features = extract_features(mask, IMAGE_SIZE)
 
148
  # Ensure output is exactly what Gradio expects
149
  overlay = overlay.astype(np.uint8)
150
  assert overlay.ndim == 3 and overlay.shape[2] == 3
 
151
  return overlay, features_text, diagnosis_text, risk_label
152
  # ── Gradio UI ─────────────────────────────────────────────────────────────────
153