Skip To Content

Deep Learning Model To Ecd

Available with Spatial Analyst license.

Available with Image Analyst license.

Summary

Converts a deep learning model to an Esri Classifer Definition file.

This tool that adds missing class information to the model. Deep learning binary model files generated by Google TensorFlow, Microsoft CNTK, or similar applications are supported.

In order to utilize the deep learning .ecd file, the deep learning framework needs to be installed on your computer. The .ecd output file will currently only work as input to the Esri Python adaptor function Classify or Detect. The class information json file allows you to add useful information to the .ecd file not included in the deep learning binary model such as class names, class colors to be used for rendering the classified output, and other standard information are included in the .ecd file. See the JSON file example below for more details.

Usage

  • An example of a Input Esri Extra Info File is shown here.

    sample of an in_extra_info_json file

    {  
       "ImportDeepLearningModelToEsriExtraInfo":0,
       "Version":1,
       "Classifier":"CNTK",
       "NumberRasterBands":4,
       "MiniBatchSize":16,
       "Classes":[  
          {  
             "Value":100,
             "Name":"Impervious",
             "Color":[204, 204, 204]
          },
          {  
             "Value":200,
             "Name":" Other (Pervious)",
             "Color":[56, 168, 0]
          }
       ]
    }

Syntax

DeepLearningModelToEcd (in_deep_learning_model, in_classification_info_json, out_classifier_definition)
ParameterExplanationData Type
in_deep_learning_model

The binary model file generated by deep learning packages such as Google TensorFlow or Microsoft CNTK, or similar.

File
in_classification_info_json

The class information JSON file. See JSON file example above.

File
out_classifier_definition

The .ecd file that can be used in the Classify function and Classify Raster tool.

The .ecd output file will currently only work as input to the Esri Python adaptor function Classify or Detect.

File

Code sample

DeepLearningModelToEcd example 1 (Python window)

This example creates an .ecd file from deep learning.

from arcpy.sa import *

DeepLearningModelToEcd("c:/test/cntk.model", "c:/test/classInfo.json", 
                       "c:/test/deeplearningtoecd.ecd")
DeepLearningModelToEcd example 2 (stand-alone script)

This example creates an .edc file from deep learning.

# Import system modules and check out ArcGIS Spatial Analyst extension license
import arcpy
arcpy.CheckOutExtension("Spatial")
from arcpy.sa import *

# Set local variables
in_deep_learning_model = "c:/test/cntk.model"
in_classification_info_json = "c:/test/classInfo.json"
out_classifier_definition = "c:/test/deeplearningtoecd.ecd"

# Execute 
DeepLearningModelToEcd(in_deep_learning_model, in_classification_info_json, 
                      out_classifier_definition)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • ArcGIS Desktop Basic: Requires Spatial Analyst or Image Analyst
  • ArcGIS Desktop Standard: Requires Spatial Analyst or Image Analyst
  • ArcGIS Desktop Advanced: Requires Spatial Analyst or Image Analyst

Related topics