This task classifies a raster using a trained TensorFlow grid model. The output is a shapefile of bounding boxes for each class.Performs inference on a raster using a trained TensorFlow grid model.

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

Example


Use the trained grid model created with the example in TrainTensorFlowGridModel Task to perform grid classification. Tutorial files are located in the object_detection folder of ENVI Tutorial data that was previously downloaded.

; Start the application
e = ENVI()
 
; Select a raster to classify.
; Update the following line with the correct path
; to the tutorial data files.
RasterFile = 'C:\MyTutorialFiles\ImageToClassify.dat'
Raster = e.OpenRaster(RasterFile)
 
; Select a trained model.
; Update the following line with the correct path
; to the model generated with documentation example
; TrainTensorFlowGridModel.
ModelFile = 'C:\TrainTensorFlowGridExampleModel.h5'
Model = ENVITensorFlowGridModel(ModelFile)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('TensorFlowGridClassification')
 
; Select task inputs
Task.INPUT_RASTER = Raster
Task.INPUT_MODEL = Model
Task.CONFIDENCE_THRESHOLD = 0.7
 
; Run the task
Task.Execute
 
; Get the classification vector output
Result = Task.OUTPUT_VECTOR
; Add data to the Data Manager
e.Data.Add, Raster
e.Data.Add, Result
; Access the view
View = e.GetView()
 
; Create the layers
Layer1 = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(Result)
; Zoom in
View.Zoom, 1.334, /IN
 
; Go to a location were handicap spots were detected
view.GoToLocation, 3114577.1086, 1762493.9804, /MAP
end

Syntax


Result = ENVITask('TensorFlowGridClassification')

Input Properties (Get, Set): CONFIDENCE_THRESHOLD, INPUT_RASTER, INPUT_MODEL, OUTPUT_VECTOR_URI

Output Properties (Get): OUTPUT_VECTOR

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:

CONFIDENCE_THRESHOLD (optional)

Specify a floating-point threshold value between 0 and 1.0. Grid cells with a confidence score less than this value will be discarded. The default value is 0.2. Decreasing this value generally results in more classification grid cells throughout the scene. Increasing it results in fewer classification grid cells.

INPUT_RASTER (required)

Specify the raster to classify.

INPUT_MODEL (required)

Specify a trained TensorFlow object model to use for classifying the INPUT_RASTER.

OUTPUT_VECTOR

Specify the output shapefile with the classified features.

OUTPUT_VECTOR_URI (optional)

Specify a string with the fully qualified filename and path for the OUTPUT_VECTOR.

Version History


Deep Learning 3.0

Introduced

See Also


TrainTensorFlowGridModel Task