Publish Deep Learning Model

URL:
https://<rasteranalysistools-url>/PublishDeepLearningModel
Methods:
GET
Version Introduced:
10.8.1

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:

Use dark colors for code blocksCopy
1
2
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

Use dark colors for code blocksCopy
1
2
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:

Use dark colors for code blocksCopy
1
2
3
4
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}

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

Use dark colors for code blocksCopy
1
https://<raster analysis tools url>/PublishDeepLearningModel/jobs/<jobId>
ParameterDetails

outItem

(Required)

The response returns the .dlpk portal item id.

Example:

Example

Use dark colors for code blocksCopy
1
2
3
{
  "url": "http://<raster analysis url>/PublishDeepLearningModel/jobs/<jobId>/results/outItem"
}

Results in:

Use dark colors for code blocksCopy
1
2
3
{
  “itemId”:”c3f5e92474084a07b1134ab9d53fa126”
}

JSON Response example

An example of a successful JSON response is detailed below:

Details

Response Example:

Use dark colors for code blocksCopy
1
2
3
modelLocation: /fileShares/deeplearningdatastorename/trainedModel
outputName: {"name":"trainedModel"}
overwriteModel: false

Successful response output:

Use dark colors for code blocksCopy
1
2
3
4
5
{
"paramName": "outItem",
"dataType": "GPString",
"value": {"itemId": "a2efad91b49f455e9cd29a340dc1887d"}
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.