how to set the parameters for sam2 for sentinel 2 visual bands? #328
Replies: 1 comment
|
For a conventional 13-band Sentinel-2 stack, first make sure SAM receives a true-color 10 m composite rather than the first three stored bands. In the current Your proposed quality thresholds ( from samgeo.samgeo2 import SamGeo2
sam = SamGeo2(
model_id="sam2-hiera-large",
device="cuda",
automatic=True,
apply_postprocessing=True,
points_per_side=64,
points_per_batch=8,
pred_iou_thresh=0.80,
stability_score_thresh=0.92,
stability_score_offset=1.0,
mask_threshold=0.0,
box_nms_thresh=0.7,
crop_n_layers=1,
crop_nms_thresh=0.7,
crop_overlap_ratio=0.5,
crop_n_points_downscale_factor=2,
min_mask_region_area=25,
output_mode="binary_mask",
use_m2m=False,
multimask_output=False,
)
sam.generate(
"sentinel2.tif",
output="objects.tif",
bands=[4, 3, 2],
unique=True,
)At 10 m resolution, one pixel represents 100 m², so For smaller objects, tune in this order:
Also mask clouds and nodata, apply a consistent reflectance stretch to 8-bit RGB, and process large scenes as overlapping tiles. SAM2 is trained on natural RGB imagery and is not inherently multispectral or semantic: it will produce object masks, not Sentinel-2 land-cover classes. Validate parameter choices against labeled polygons using object recall/precision or IoU on representative tiles instead of selecting them visually from one scene. |
Uh oh!
There was an error while loading. Please reload this page.
How to set the parameters for sam2 for sentinel 2 visual bands?
Parameters:
context:
All reactions