Skip To Content ArcGIS for Developers Sign In Dashboard

Publish Deep Learning Model

Description

Publish Deep Learning Model

The PublishDeepLearningModel operation publishes a model package of a deep learning model (.dlpk) containing the files and data required to run deep learning inferencing tools for object detection or image classification to your portal as a DLPK item.

Deep learning model packages must contain an Esri model definition file (.emd) and a trained model file. The trained model file extension depends on the framework you used to train the model. For example, if you trained your model using TensorFlow, the model file will be a TensorFlow (.pb) file, while a model trained using Keras will generate an Keras (.h5) file. Depending on the model framework and options you used to train your model, you may need to include a Python Raster Function (.py) or additional files.

Request parameters

ParameterDetails
modelLocation

(Required)

The datastore location of the deep learning model that needs to be uploaded to the portal. The modelLocation can be the path pointing to the dlpk file or the folder containing the deep learning model files (emd, trained model file and other additional files.)

Syntax: A string describing the path of the model location.

Example:

modelLocation=”/fileShares/datastorename/modelFolder”
modelLocation=”/fileShares/datastorename/modelFolder/modelfile.dlpk”
outputName

(Required)

The name of the portal item. If the item already exists, the portal item ID can be given to the service tool. The current path of the .dlpk file will be used to update the existing .dlpk item.

Example

output_name={"name":"trainedModel"}
output_name={"name":"trainedModel","folderId":"dfwerfbd3ec25584d0d8f4"}
f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

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>/PublishDeepLearningModel/jobs/<jobId>

ParameterDetails
outItem

(Required)

The response returns the .dlpk portal item id.

Example:

Example

{
  "url": "http://<raster analysis url>/PublishDeepLearningModel/jobs/<jobId>/results/outItem"
}

Results in:

{
  “itemId”:”c3f5e92474084a07b1134ab9d53fa126”
}

JSON Response example

An example of a successful JSON response is detailed below:

Details

Response Example:

modelLocation: /fileShares/deeplearningdatastorename/trainedModel
outputName: {"name":"trainedModel"}
overwriteModel: false

Successful response output:

{
"paramName": "outItem",
"dataType": "GPString",
"value": {"itemId": "a2efad91b49f455e9cd29a340dc1887d"}
}