This task classifies a raster using a trained object detection model. The output is a shapefile of bounding boxes for each class.
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 of the .zip file to a local directory. Files are located in the object_detection folder.
This example classifies an image using a trained object detection model that looks for parking spots with handicap signs painted on the pavement; for example:
e = ENVI()
RasterFile = 'C:\MyTutorialFiles\ImageToClassify.dat'
Raster = e.OpenRaster(RasterFile)
ModelFile = 'C:\MyTutorialFiles\ObjectDetectionModel_HandicapSpots.h5'
Model = ENVITensorFlowObjectModel(ModelFile)
Task = ENVITask('TensorFlowObjectClassification')
Task.INPUT_RASTER = Raster
Task.INPUT_MODEL = Model
Task.CONFIDENCE_THRESHOLD = 0.8
Task.NMS_IOU_THRESHOLD = 0.1
Task.Execute
e.Data.Add, Task.OUTPUT_VECTOR
View = e.GetView()
Layer = View.CreateLayer(Raster)
Layer2 = View.CreateLayer(Task.OUTPUT_VECTOR)
Syntax
Result = ENVITask('TensorFlowObjectClassification')
Input Properties (Get, Set): CONFIDENCE_THRESHOLD, INPUT_RASTER, INPUT_MODEL, IOU_THRESHOLD, 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. Bounding boxes with a confidence score less than this value will be discarded before applying the IOU_THRESHOLD. The default value is 0.2. Decreasing this value generally results in more classification bounding boxes throughout the scene. Increasing it results in fewer classification bounding boxes.
INPUT_RASTER (required)
Specify the raster to classify.
INPUT_MODEL (required)
Specify a trained TensorFlow object model to use for classifying INPUT_RASTER.
IOU_THRESHOLD (optional)
Specify a floating-point value between 0 and 1.0, indicating the Non-Maximum Suppression Intersection over Union (NMS IOU) value. This is a TensorFlow object detection parameter that reduces detection clustering by pruning predicted bounding boxes that have high IOU overlap with previously selected boxes. The default value is 0.5. Increasing this value results in more bounding boxes around identified features. Decreasing the value results in fewer bounding boxes.
OUTPUT_VECTOR
This is the output shapefile with the classified features.
OUTPUT_VECTOR_URI (optional)
Specify a string with the fully qualified filename and path for OUTPUT_VECTOR.
Version History
See Also
TrainTensorFlowObjectModel Task, TensorFlowObjectClassification Task, ENVIDeepLearningObjectDetectionRaster, BuildObjectDetectionRasterFromAnnotation Task