Anigor66 commited on
Commit
81144e1
·
1 Parent(s): 548ad6f

Changed points per side

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -78,12 +78,12 @@ print("✓ SamPredictor initialized for interactive segmentation")
78
  # is more stable for our use case.
79
  mask_generator = SamAutomaticMaskGenerator(
80
  model=sam,
81
- points_per_side=32, # Grid density (32x32 = 1024 points)
82
- pred_iou_thresh=0.7, # IoU threshold for filtering (lowered from 0.88)
83
- stability_score_thresh=0.7, # Stability threshold (lowered from 0.95 - was too strict)
84
  crop_n_layers=0, # Disable multi-scale crops to avoid IndexError
85
  crop_n_points_downscale_factor=2,
86
- min_mask_region_area=0 # Minimum mask area (lowered from 100 to allow small masks)
87
  )
88
  print("✓ SamAutomaticMaskGenerator initialized for automatic segmentation")
89
  print("✓ SAM model loaded successfully from HuggingFace Hub!")
 
78
  # is more stable for our use case.
79
  mask_generator = SamAutomaticMaskGenerator(
80
  model=sam,
81
+ points_per_side=16, # Lighter grid (16x16) for faster CPU + smaller responses
82
+ pred_iou_thresh=0.7, # IoU threshold for filtering
83
+ stability_score_thresh=0.7, # Stability threshold
84
  crop_n_layers=0, # Disable multi-scale crops to avoid IndexError
85
  crop_n_points_downscale_factor=2,
86
+ min_mask_region_area=0 # Allow small masks (backend can filter if needed)
87
  )
88
  print("✓ SamAutomaticMaskGenerator initialized for automatic segmentation")
89
  print("✓ SAM model loaded successfully from HuggingFace Hub!")