sohamnk commited on
Commit
c694458
·
verified ·
1 Parent(s): 74eecc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -84,7 +84,7 @@ def detect_and_crop(image: Image.Image, object_name: str) -> Image.Image:
84
  with torch.no_grad():
85
  outputs = model_gnd(**inputs)
86
  results = processor_gnd.post_process_grounded_object_detection(
87
- outputs, inputs.input_ids, box_threshold=0.4, text_threshold=0.3, target_sizes=[(height, width)]
88
  )
89
  if not results or len(results[0]['boxes']) == 0:
90
  print(" [Detect & Crop] ⚠ Warning: Grounding DINO did not detect the object. Using full image.")
 
84
  with torch.no_grad():
85
  outputs = model_gnd(**inputs)
86
  results = processor_gnd.post_process_grounded_object_detection(
87
+ outputs, inputs.input_ids, threshold=0.4, text_threshold=0.3, target_sizes=[(height, width)]
88
  )
89
  if not results or len(results[0]['boxes']) == 0:
90
  print(" [Detect & Crop] ⚠ Warning: Grounding DINO did not detect the object. Using full image.")