- URL:
- https://<rasteranalysis-url>/ClassifyObjectsUsingDeepLearning
- Methods:
GET
- Version Introduced:
- 10.8
Description
The Classify
task is used to classify objects based on overlaid imagery data using the designated deep learning model and generate a feature service with a new assigned label for each object.
Request parameters
Parameter | Details |
---|---|
(Required) | The input image used to classify objects. This can be specified as the portal item ID, image service URL, cloud raster dataset, shared raster dataset, a feature service with image attachments, or a raster dataset or image collection in the data store. At least one type of input must be provided in the JSON object. If multiple inputs are provided, the Syntax: A JSON object describes the input raster. Example:
|
(Optional) | The feature service layer that contains the points, polylines, or polygons that identify the location of each object to be classified and labeled. The layer index is needed for the feature service URL. Syntax: A JSON object describes the input feature service layer. Example:
Example
|
(Required) | The output hosted feature service properties. If you're using an existing hosted feature service, the portal item ID or service URL can be provided, and 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 service properties provided. The output hosted feature service is stored and shared on the hosting server. Syntax: A JSON object describes the output feature service. Example:
|
(Required) | The deep learning model used to classify objects. This can be specified as the deep learning model portal item ID, as an Syntax: A JSON object describes the model. Example:
Example for JSON:
|
(Optional) | The name of the value pairs of arguments and their values that can be customized by the clients. Syntax: A JSON object describes the value pairs of arguments. Example:
|
(Optional) | The name of the field that will contain the classification label in the output feature service. Syntax: String. Example:
|
(Optional) | Specifies how all raster items in an image service will be processed. If set to Values: Example:
|
(Optional) | The environment settings that affect task execution. This task has the following settings:
Example
|
|
The response format. The default response format is html. Values: |
Example usage
The following is a sample request URL for Classify
:
https://machine.domain.com/webadaptor/rest/services/System/RasterAnalysisTools/GPServer/ClassifyObjectsUsingDeepLearning?
inputRaster="url":"https://<server name>/arcgis/ArcGIS/rest/services/World_Imagery/MapServer"&inputFeatures="url":"https://<server name>/arcgis/server/rest/services/Hosted/test_parkinglot/FeatureServer/0"&outputFeatureClass={"serviceProperties":{"name":"test10210453"}}&model={"itemId": "d8d3902b41854529a907ad9f42af5a06"}&modelArguments={"padding": "0", "batch_size": "16"}&classLabelField=ClassLabel&processAllRasterItems=false&context={"extent": {"xmin": -13160539.4563053,"ymin": 3998752.62631951,"xmax": -13160427.5538234,"ymax": 3998824.51069532,"spatialReference": {"wkid": 3857}},"processorType": "CPU","parallelProcessingFactor": 2}}&f=json
The following is a sample POST request for Classify
:
POST /webadaptor/rest/services/System/RasterAnalysisTools/GPServer/ClassifyObjectsUsingDeepLearning HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
inputRaster={"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"}&inputFeatures={"url":"https://<server name>/arcgis/server/rest/services/Hosted/test_parkinglot/FeatureServer/0"}&outputFeatureClass={"serviceProperties": {"name":"test10210453"}}&model={"itemId": "d8d3902b41854529a907ad9f42af5a06"}modelArguments={"padding": "0", "batch_size": "16"
}classLabelField=ClassLabel&processAllRasterItems=false&context={"extent": {"xmin": -13160539.4563053,"ymin": 3998752.62631951,"xmax": -13160427.5538234,"ymax": 3998824.51069532,"spatialReference": {"wkid": 3857}},"processorType": "CPU", "parallelProcessingFactor": 2}}&f=json
Both of the requests above use the following parameters and values in their request:
inputRaster={"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"}
iputFeatures={"url":"https://<server name>/arcgis/server/rest/services/Hosted/test_parkinglot/FeatureServer/0"}
outputFeatureClass={"serviceProperties":{"name":"test10210453"}}
model={"itemId": " d8d3902b41854529a907ad9f42af5a06"}
modelArguments={"padding": "0", "batch_size": "16"}
classLabelField=ClassLabel
processAllRasterItems=false
context={"extent": {"xmin": -13160539.4563053,"ymin": 3998752.62631951,"xmax": -13160427.5538234,"ymax": 3998824.51069532,"spatialReference": {"wkid": 3857}}, "processorType": "CPU", "parallelProcessingFactor": 2}}
f=json
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 job
to periodically check the status of the job and messages, as described in Check job status. Once the job has successfully completed, use the job
to retrieve the results. To track the status, you can make a request of the following form:
https://<rasterAnalysisTools-url>/AddImage/jobs/<jobId>
When the status of the job request is esri
, you can access the results of the analysis by making a request of the following form:
https://<rasterAnalysisTools-url>/AddImage/jobs/<jobId>/results/outObjects
JSON Response example
The response returns the out
output parameter, which has properties for parameter name, data type, and value. The content of value is always the output feature layer item ID and the image service URL.
{
"paramName": "outObjects",
"dataType": "GPFeatureRecordSetLayer",
"value": {
"itemId": "f121390b85ef419790479fc75b493efd",
"url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/FeatureServer"
}
}