obichimav commited on
Commit
7f884bb
·
verified ·
1 Parent(s): 5a4e1c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -416,18 +416,18 @@ def detect_objects(query_text):
416
 
417
  # Use multiple models for detection and get high confidence results
418
  # First try the specialized detector
419
- detections = T.countgd_object_detection(object_name, image, conf_threshold=0.75)
420
 
421
  # If no high-confidence detections, try the more general object detector
422
  if not detections:
423
  # Try a different model with the same high threshold
424
  try:
425
- detections = T.grounding_dino_detection(object_name, image, box_threshold=0.75)
426
  except:
427
  pass
428
 
429
  # Only keep high confidence detections
430
- high_conf_detections = [det for det in detections if det.get("score", 0) > 0.75]
431
 
432
  # Visualize only high confidence results with clear labeling
433
  result_image = T.overlay_bounding_boxes(
 
416
 
417
  # Use multiple models for detection and get high confidence results
418
  # First try the specialized detector
419
+ detections = T.countgd_object_detection(object_name, image, conf_threshold=0.55)
420
 
421
  # If no high-confidence detections, try the more general object detector
422
  if not detections:
423
  # Try a different model with the same high threshold
424
  try:
425
+ detections = T.grounding_dino_detection(object_name, image, box_threshold=0.55)
426
  except:
427
  pass
428
 
429
  # Only keep high confidence detections
430
+ high_conf_detections = [det for det in detections if det.get("score", 0) > 0.55]
431
 
432
  # Visualize only high confidence results with clear labeling
433
  result_image = T.overlay_bounding_boxes(