LPX commited on
Commit
4b48107
·
1 Parent(s): a7003f1

refactor: rename predict_image_with_json to predict_with_ensemble and update its implementation to return consensus label

Browse files
Files changed (1) hide show
  1. app_mcp.py +3 -3
app_mcp.py CHANGED
@@ -265,9 +265,9 @@ def get_consensus_label(results):
265
  color = {"AI": "red", "REAL": "green", "UNCERTAIN": "orange"}.get(consensus, "gray")
266
  return f"<b><span style='color:{color}'>{consensus}</span></b>"
267
 
268
- # Update predict_image_with_json to return consensus label
269
 
270
- def predict_image_with_json(img, confidence_threshold, augment_methods, rotate_degrees, noise_level, sharpen_strength):
271
  # Ensure img is a PIL Image (if it's not already)
272
  if not isinstance(img, Image.Image):
273
  try:
@@ -362,7 +362,7 @@ def predict_image_with_json(img, confidence_threshold, augment_methods, rotate_d
362
  # 6. Perform forensic processing
363
  gradient_image = gradient_processing(img_np_og) # Added gradient processing
364
  minmax_image = minmax_process(img_np_og) # Added MinMax processing
365
- bitplane_image = bit_plane_extractor(img_np_og)
366
 
367
 
368
  # First pass - standard analysis
 
265
  color = {"AI": "red", "REAL": "green", "UNCERTAIN": "orange"}.get(consensus, "gray")
266
  return f"<b><span style='color:{color}'>{consensus}</span></b>"
267
 
268
+ # Update predict_with_ensemble to return consensus label
269
 
270
+ def predict_with_ensemble(img, confidence_threshold, augment_methods, rotate_degrees, noise_level, sharpen_strength):
271
  # Ensure img is a PIL Image (if it's not already)
272
  if not isinstance(img, Image.Image):
273
  try:
 
362
  # 6. Perform forensic processing
363
  gradient_image = gradient_processing(img_np_og) # Added gradient processing
364
  minmax_image = minmax_process(img_np_og) # Added MinMax processing
365
+ bitplane_image = bit_plane_extractor(img_pil)
366
 
367
 
368
  # First pass - standard analysis