Skip To Content

Use the model

You can use the HF Object Classification pretrained model in the Classify Objects Using Deep Learning tool available in the Image Analyst toolbox in ArcGIS Pro.

Classify objects

Complete the following steps to use HF object classification from the imagery:

  1. Download the HF Object Classification model.
  2. Click Add data to add an image to the Contents pane.
    Banner image

    You'll run the prediction on this image.

  3. Click the Analysis tab and click Tools.
    Tools on the Analysis tab in ArcGIS Pro
  4. In the Geoprocessing pane, click the Toolboxes tab, expand Image Analyst Tools, expand Deep Learning, and select the Classify Objects Using Deep Learning tool.
    Classify Objects Using Deep Learning tool
  5. On the Parameters tab, set the variables as follows:
    1. Input Raster—Choose an input image from the drop-down menu or from a folder location.
    2. Output Classified Objects Feature Class—Set the output feature layer that will contain the classification label and confidence score.
    3. Model Definition—Select the pretrained model .dlpk file.
    4. Arguments—Change the values of the arguments if required.

      • huggingface_id—The model ID of a pretrained HF object classification model hosted on huggingface.co

        Image classification models can be filtered by choosing the Image Classification tag in the Tasks list on the Hugging Face model hub, as shown below:

        Image Classification on the model hub

        The model ID consists of the {username}/{repository} as displayed at the top of the model page, as shown below:

        Model ID

        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:

        config.json and preprocessor_config.json on the Files and versions tab
      • 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.
      • batch_size—The number of image tiles processed in each step of the model inference. This depends on the memory of your graphics card.

      Classify Objects Using Deep Learning Parameters tab
  6. On the Environments tab, set the variables as follows:
    1. Processing Extent—Select the default extent or any other option from the drop-down menu.
    2. Processor Type—Select CPU or GPU as needed.

      It is recommended that you select GPU, if available, and set GPU ID to the GPU to be used.

      Classify Objects Using Deep Learning Environments tab
  7. Click Run.

    The output layer is added to the map. The ClassLabel column of the attribute table contains the predicted class and Confidence column contains the confidence score.

    Classified result

In this topic
  1. Classify objects