Spaces:
Runtime error
Runtime error
Anigor66 commited on
Commit ·
81144e1
1
Parent(s): 548ad6f
Changed points per side
Browse files
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=
|
| 82 |
-
pred_iou_thresh=0.7, # IoU threshold for filtering
|
| 83 |
-
stability_score_thresh=0.7,
|
| 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 #
|
| 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!")
|