You can use this model in the Detect Objects Using Deep Learning tool available in the Image Analyst toolbox in ArcGIS Pro. Complete the following steps to use the model for detecting masks of various objects in the image.
Detect objects
Complete the following steps to detect masks of various objects from imagery:
- Ensure that you have downloaded the Segment Anything Model (SAM) pretrained model and added the imagery layer in ArcGIS Pro.
- Either zoom to an area of interest or use the entire image.
- Click the Analysis tab and browse to Tools.
- Click the Toolboxes tab in the Geoprocessing pane, select Image Analyst Tools, and browse to the Detect Objects Using Deep Learning tool tool under Deep Learning.
- Set the variables on the Parameters tab as follows:
- Input Raster—Select the imagery.
- Output Detected Objects—Set the output feature class that will contain the detected objects.
- Model Definition—Select the pretrained or fine-tuned model .dlpk file.
- Arguments—Change the values of the arguments if
required.
- padding—Number of pixels at the border of image tiles from which predictions are blended for adjacent tiles. Increase its value to smooth the output while reducing edge artifacts. The maximum value of the padding can be half of the tile size value.
- batch_size—Number of image tiles processed in each step of the model inference. This depends on the memory of your graphics card.
- box_nms_thresh—The box IoU cutoff used by non-maximal suppression to filter duplicate masks.
- points_per_batch—Sets the number of points run simultaneously by the model. Higher numbers may be faster but will use more GPU memory.
- stability_score_thresh —The detections that have a confidence score higher than this threshold are included in the result. The allowed values range from 0 to 1.0.
- min_mask_region_area—If >0, postprocessing will be applied to remove disconnected regions and holes in masks with area smaller than min_mask_region_area.
- Non Maximum Suppression—Optionally, check the check box to remove the overlapping features with lower confidence.
If checked, do the following:
- Set Confidence Score Field.
- Set Class Value Field (optional).
- Set Max Overlap Ratio (optional).
- Set the variables on the Environments tab by selecting Processor Type as CPU or GPU.
If GPU is available, it is recommended that you select GPU, and set GPU ID to the GPU to be used.
- Click Run.
As soon as processing finishes, the output layer is added to the map.