facebookresearch / facebookresearch/segment-anything
crop_n_layers but do not segment anything other than the last layer
- Dominant language
- Jupyter Notebook
- Stars
- 54.9k
- Forks
- 6.4k
- PR merge metrics
- No merged PRs in 30d
Description
Current config:
```python
mask_generator = SamAutomaticMaskGenerator(
model = meta_sam,
points_per_side = 32,
pred_iou_thresh = 0.86,
stability_score_thresh = 0.92,
crop_n_layers = 2, # Each layer has (2**i)**2 boxes for the ith layer.
crop_n_points_downscale_factor = 1.2,
)
```
I am working with very large satellite images which do not fit into GPU memory. For this purpose, I'd like to utilize crop_n_layers but even though it segments crops, it also tries to segment the original image as well as any layer. So, it again doesn't fit into the memory. Any help would be greatly appreciated.
What is better could be checking the crop size and if it's larger than a limit, skip the layer altogether.
Contributor guide
Research direction
Start by locating SamAutomaticMaskGenerator and trace how crop_n_layers schedules the original image and cropped layers. Determine how a configurable crop-size limit or last-layer-only behavior should affect processing, then verify that oversized layers are skipped without preventing the intended crops from being segmented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100