You can use this model in the Detect Objects Using Deep Learning tool available in the Image Analyst toolbox in ArcGIS Pro.
Detect objects
Complete the following steps to detect objects in the imagery:
- Ensure that you have downloaded the HF Object Detection pretrained model and added the imagery layer in ArcGIS Pro.
- Either zoom to an area of interest or use the entire imagery.
- Click the Analysis tab and click Tools.
- In the Geoprocessing pane, click the Toolboxes tab, expand Image Analyst Tools, expand Deep Learning, and select the Detect Objects Using Deep Learning tool.
- On the Parameters tab, set the variables 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 model .dlpk file.
- Model Arguments—Change the values of the arguments if
required.
- huggingface_id— model ID of a pretrained object detection model hosted on huggingface.co
Object detection models can be filtered by choosing the Object Detection tag in the Tasks list on the Hugging Face model hub, as shown below:
The model ID consists of the {username}/{repository} as displayed at the top of the model page, as shown below:
Only those models that have config.json and preprocessor_config.json are supported. The presence of these files can be verified on the Files and versions tab of the model page, as shown below:
- padding—The 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.
- threshold—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.
- nms_overlap—The maximum overlap ratio for two overlapping features, which is defined as the ratio of intersection area over union area. The default is 0.1.
- batch_size—The number of image tiles processed in each step of the model inference. This depends on the memory of your graphics card.
- exclude_pad_detections—If true, filters potentially truncated detections near the edges that are in the padded region of image chips.
- test_time_augmentation—Performs test time augmentation while predicting. This is a technique used to improve the robustness and accuracy of model predictions. It involves applying data augmentation techniques during inferencing, which means generating multiple slightly modified versions of the test data and aggregating the predictions. If true, predictions of flipped and rotated orientations of the input image will be merged into the final output and their confidence values are averaged. This may cause the confidence to fall below the threshold for objects that are only detected in a few orientations of the image.
- huggingface_id— model ID of a pretrained object detection model hosted on huggingface.co
- 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 as follows:
- Processing Extent—Select Current Display Extent or any other option from the drop-down menu.
- Cell Size (required)—Set the value based on the object size.
- Processor Type—Select CPU or GPU.
It is recommended that you select GPU, if available, and set GPU ID to specify the GPU to be used.
- Click Run.
The output layer is added to the map.