Detect Objects Using Deep Learning (Raster Analysis)

Title  Detect Objects Using Deep Learning (Raster Analysis)

Summary

In a raster analysis deployment, this tool runs a trained deep learning model on an input raster to produce a feature class containing the objects it identifies. The feature class can be shared as a hosted feature layer in your portal. The features can be bounding boxes or polygons around the objects found, or points at the centers of the objects.


Illustration

Detect Objects Using Deep Learning tool illustration Detect Objects Using Deep Learning tool illustration

Usage


Syntax

Parameter Explanation
inputRaster

The input image used to detect objects. It can be an image service URL, a raster layer, an image service, a map server layer, or an internet tiled layer.

inputModel

The input model can be a file or a URL of a deep learning package (.dlpk) item from the portal.

outputName

The name of the output feature service of detected objects.

modelArguments (Optional)

The function model arguments are defined in the Python raster function class referenced by the input model. This is where you list additional deep learning parameters and arguments for experiments and refinement, such as a confidence threshold for fine tuning the sensitivity. The names of the arguments are populated by the tool from reading the Python module on the RA server.

runNMS (Optional)

Specifies whether non maximum suppression, where duplicate objects are identified and the duplicate feature with a lower confidence value is removed, will be performed.

  • Unchecked—All detected objects will be in the output feature class. This is the default.
  • Checked— Duplicate detected objects will be removed.

confidenceScoreField (Optional)

The field in the feature service that contains the confidence scores that will be used as output by the object detection method.

This parameter is required when the Non Maximum Suppression parameter is checked.

classValueField (Optional)

The name of the class value field in the feature service.

If a field name is not specified, the tool will attempt to use a Classvalue or Value field. If these fields do not exist, the tool will identify all records as belonging to one class.

maxOverlapRatio (Optional)

The maximum overlap ratio for two overlapping features, which is defined as the ratio of intersection area over union area. The default is 0.

Code Samples

DetectObjectsUsingDeepLearning_ra example 1 (Python window)

This example creates a hosted feature layer in your portal based on object detection using the DetectObjectsUsingDeepLearning tool.


import arcpy
arcpy.DetectObjectsUsingDeepLearning_ra(
        "https://myserver/rest/services/Farm/ImageServer",
        "https://myportal/sharing/rest/content/items/itemId", "detectedTrees",
"score_threshold 0.6;padding 0", "NO_NMS")
                    

DetectObjectsUsingDeepLearning example 2 (stand-alone script)

This example creates a hosted feature layer in your portal based on object detection using the DetectObjectsUsingDeepLearning tool.


#---------------------------------------------------------------------------
# Name: DetectObjectsUsingDeepLearning_example02.py
# Requirements: ArcGIS Image Server
# Import system modules
import arcpy
# Set local variables
inImage = "https://myserver/rest/services/coconutFarmImage/ImageServer"
inModel = "https://myportal/sharing/rest/content/items/itemId"
outName = "detectedTrees"
modelArgs = "score_threshold 0.6;padding 0"
runNMS = "NMS"
confScoreField = "Confidence"
classVField = "Class"
maxOverlapRatio = 0.15 
# Execute Detect Objects Using raster analysis tool
arcpy.DetectObjectsUsingDeepLearning_ra(inImage, inModel, outName, modelArgs,
runNMS, confScoreField, ClassVField, maxOverlapRatio)
                    

Tags

Credits

Use limitations