Skip To Content

Use the model

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:

  1. Ensure that you have downloaded the Segment Anything Model (SAM) pretrained model and added the imagery layer in ArcGIS Pro.
  2. Either zoom to an area of interest or use the entire image.
    Area of interest
  3. Click the Analysis tab and browse to Tools.
    Tools on the analysis tab in ArcGIS Pro
  4. 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.
    Detect Objects Using Deep Learning tool
  5. Set the variables on the Parameters tab as follows:
    1. Input Raster—Select the imagery.
    2. Output Detected Objects—Set the output feature class that will contain the detected objects.
    3. Model Definition—Select the pretrained or fine-tuned model .dlpk file.
    4. 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.
    5. 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).
    Parameters tab
  6. 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.

    Environments tab
  7. Click Run.

    As soon as processing finishes, the output layer is added to the map.

    Output layer

In this topic
  1. Detect objects