segment-anything
segment-anything copied to clipboard
crop_n_layers but do not segment anything other than the last layer
Current config:
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.