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.
e = ENVI()
RasterFile = 'C:\MyTutorialFiles\ImageToClassify.dat'
Raster = e.OpenRaster(RasterFile)
ModelFile = 'C:\TrainTensorFlowGridExampleModel.h5'
Model = ENVITensorFlowGridModel(ModelFile)
Task = ENVITask('TensorFlowGridClassification')
Task.INPUT_RASTER = Raster
Task.INPUT_MODEL = Model
Task.CONFIDENCE_THRESHOLD = 0.7
Task.Execute
Result = Task.OUTPUT_VECTOR
e.Data.Add, Raster
e.Data.Add, Result
View = e.GetView()
Layer1 = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(Result)
View.Zoom, 1.334, /IN
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