This task has been depricated and renamed to TensorFlowPixelClassification.

This task classifies a raster using a trained TensorFlow mask-based model. The result is a classification image. An optional output is a class activation raster whose pixel values represent the probability (0 to 1) of matching the feature of interest. If necessary, this task will convert a raster into an ENVIDeepLearningRaster for classification. To avoid having to convert the same input raster again, use the BuildDeepLearningRaster task once to convert it to an ENVIDeepLearningRaster.

This task is part of ENVI Deep Learning, which requires a separate license and installation.

Example


Sample data files are available on our ENVI Tutorials web page. Click the "Deep Learning" link in the ENVI Tutorial Data section to download a .zip file containing the data. Extract the contents to a local directory. Files are located in the tornado directory.

This example classifies an orthophoto of a seaport using a model that was previously trained to find shipping containers. It displays the resulting class activation raster over the input orthophoto. Toggle the class activation raster on and off in the Layer Manager to view the underlying orthophoto.

; Start the application
e = ENVI()
 
; Open the image to classify
; Update the following line with the correct path
; to the tutorial data files
File = 'C:\MyTutorialFiles\ImageToClassify.dat'
Raster = enviDeepLearningRaster(File)
 
; Open a model
; Update the following line with the correct path
; to the tutorial data files
ModelFile = 'C:\MyTutorialFiles\TrainedModel.h5' 
Model = ENVITensorFlowModel(ModelFile)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('TensorFlowMaskClassification')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.INPUT_MODEL = Model
 
; Define outputs
Task.OUTPUT_CLASSIFICATION_RASTER_URI = e.GetTemporaryFilename()
Task.OUTPUT_CLASS_ACTIVATION_RASTER_URI = e.GetTemporaryFilename()
 
; Run the task
Task.Execute
 
; Add the output to the Data Manager
e.Data.Add, Task.OUTPUT_CLASSIFICATION_RASTER
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(Task.OUTPUT_CLASSIFICATION_RASTER)
View.Zoom, /FULL_EXTENT

Syntax


Result = ENVITask('TensorFlowMaskClassification')

Input properties (Set, Get): INPUT_MODEL, INPUT_RASTER, OUTPUT_CLASSIFICATION_RASTER_URI, OUTPUT_CLASS_ACTIVATION_RASTER_URI

Output properties (Get only): OUTPUT_CLASSIFICATION_RASTER, OUTPUT_CLASS_ACTIVATION_RASTER

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask. See the ENVITask topic in ENVI Help.

  • AddParameter
  • Execute
  • Parameter
  • ParameterNames
  • RemoveParameters

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

See the ENVITask topic in ENVI Help for details.

This task also contains the following properties:

INPUT_MODEL (required)

Specify the mask-based TensorFlowModel to use for classifying INPUT_RASTER.

INPUT_RASTER (required)

Specify the raster to classify.

OUTPUT_CLASSIFICATION_RASTER

This is a reference to the output classification raster of filetype ENVI. It is a single-band raster whose values range from 0 to the number of classes.

OUTPUT_CLASSIFICATION_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_CLASSIFICATION_RASTER. If you do not set this property, the classification raster will not be created. You must set this property or the OUTPUT_CLASS_ACTIVATION_RASTER_URI property. You can also set both.

OUTPUT_CLASS_ACTIVATION_RASTER

This is a reference to the output class activation raster of filetype ENVI. It is a float raster with one band for each class, including the background class, whose values range from 0 to 1.

OUTPUT_CLASS_ACTIVATION_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_CLASS_ACTIVATION_RASTER. If you do not set this property, the class activation raster will not be created. You must set this property or the OUTPUT_CLASSIFICATION_RASTER_URI property. You can also set both.

Version History


Deep Learning 1.0

Introduced

Deep Learning 1.1

Removed OUTPUT_RASTER and OUTPUT_RASTER_URI properties.

Added OUTPUT_CLASSIFICATION_RASTER, OUTPUT_CLASSIFICATION_RASTER_URI, OUTPUT_CLASS_ACTIVATION_RASTER, and OUTPUT_CLASS_ACTIVATION_RASTER_URI properties.

Deep Learning 3.0 Depricated