Detect Objects Using Deep Learning

Description

Detect Objects Using Deep Learning diagram

The DetectObjectsUsingDeepLearning operation can be used to detect objects from the imagery data using the designated deep learning model and generate a feature service for the detected objects.

Request parameters

Parameter

Details

inputRaster

(Required)

The portal item Id, image service URL, cloud raster dataset, or shared raster dataset that will be classified. At least one type of input must be provided in the JSON object. If multiple inputs are given, the itemId takes priority.

Syntax: JSON object describes the input raster.

//Portal Item ID
inputRaster={"itemId": <portal item id>}

//Image Service URL
inputRaster={"url": <image service url>}

//Feature Service URL
inputRaster={"url": <feature service url>}

//Cloud Raster URI or Shared Data Path
inputRaster={"uri": <cloud raster uri or shared data path>}

//Service Properties
inputRaster={"serviceProperties":{"name":"testrasteranalysis","serviceUrl":"https://<server name>/server/rest/services/Hosted/testrasteranalysis/ImageServer"},"itemProperties":{"itemId":"8cfbd3ec25584d0d8f4ed23b8ff7c43b", "folderId":"sdfwerfbd3ec25584d0d8f4"}}
outputObjects

(Required)

The output hosted feature service properties. If the hosted feature service is already created, the portal item Id or service URL can be given to the service tool. The output path of the feature class that is generated will be used to update the existing service definition. The service tool can also generate a new hosted feature service with the given service properties.

The output hosted feature service is stored and shared on the hosting server.

//Portal Item ID
outputObjects={"itemId": <portal item id>}

//Hosted Feature Service URL
outputObjects={"url": <hosted feature service url>}

//Feature Class Local Output Path
outputObjects={"uri": <feature class local output path>}

//Service Properties
outputObjects={"serviceProperties":{"name":"testrasteranalysis","serviceUrl":"https://<server name>/server/rest/services/Hosted/testrasteranalysis/FeatureServer"},"itemProperties":{"itemId":"8cfbd3ec25584d0d8fed23b8ff7c43b", "folderId":"sdfwerfbd3ec25584d0d8f4"}}

model

(Required)

The input for model can be a model package item uploaded to your portal, an .emd file, or the entire JSON string of the model definition.

Example for portal item:

Portal Items example

//Portal Item ID
model={"itemId": "x2u130909jcvojzkeeraedf"}

//URL with Portal Item ID
model={"url": "https://machine.domain.com/webadaptor/sharing/rest/content/items/x2u130909jcvojzkeeraedf"}

.emd File Example

model={"uri": "\\\\sharedstorage\\sharefolder\\findtrees.emd"}

JSON Object Example

model={"Framework":"TensorFlow","ModelConfiguration":"ObjectDetectionAPI","ModelFile":"frozen_inference_graph.pb","ModelType":"ObjectDetection","ImageHeight":850,"ImageWidth":850,"ExtractBands":[0,1,2],"Classes":[{"Value": 0,"Name":"Tree","Color":[0,255,0]}]}
modelArguments

The name value pairs of arguments and their values that can be customized by the clients.

modelArguments={"name1":"value1","name2": "value2"}
context

Contains additional settings that affect task execution. This task has the following settings:

  • extent—A bounding box that defines the analysis area.
  • cellSize—The output raster will have the resolution specified by cell size.
  • processorType—The specified processor (CPU or GPU) will be used for the analysis.
  • parallelProcessingFactor—The specified number or percentage of processes will be used for the analysis.
f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

Below is a sample request URL for DetectObjectsUsingDeepLearning.

https://machine.domain.com/webadaptor/rest/services/System/RasterAnalysisTools/GPServer/DetectObjectsUsingDeepLearning

Response

When you submit a request, the task assigns a unique job ID for the transaction.

Syntax:

{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}

After the initial request is submitted, you can use the jobId to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, you use the jobId to retrieve the results. To track the status, you can make a request of the following form:

https://<raster analysis tools url>/DetectObjectsUsingDeepLearning/jobs/<jobId>

When the status of the job request is esriJobSucceeded, you can access the results of the analysis by making a request of the following form:

https://<raster analysis tools url>/DetectObjectsUsingDeepLearning/jobs/<jobId>/results/outObjects

JSON Response example

The response returns the outObjects output parameter, which has properties for parameter name, data type, and value. The content of the value is always the output feature layer itemId and the image service URL.

{
  "paramName": "outObjects",
  "dataType": "GPFeatureRecordSetLayer",
  "value": {
    "itemId": "f121390b85ef419790479fc75b493efd",
    "url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
  }
}