This is a reference to an ENVITensorFlowObjectModel object, which specifies the TensorFlow object detection model used for deep learning.

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


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 directory.

This example uses an object detection model that was trained to find parking spots with handicap signs painted on the pavement; for example:

; Start the application
; Select a trained model.
; Update the following line with the correct path 
; to the tutorial data files.
ModelFile = 'C:\MyTutorialFiles\ObjectDetectionModel_HandicapSpots.h5'
Model = ENVITensorFlowObjectModel(ModelFile)
; Print the model properties
Print, Model, /IMPLIED_PRINT


Result = ENVITensorFlowObjectModel(Input_File [, Properties=value] [, ERROR=value])

Return Value

This routine returns a reference to an ENVITensorFlowObjectModel object.



Specify a fully qualified filename and path to an ENVITensorFlowObjectModel file in HDF5 format.






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.


A description of the model's capabilities.

EPOCHS (Get, Set)

An epoch is a full pass of the entire training dataset through the algorithm's learning process. Specify the number of Epochs to run. Training inputs are adjusted at the end of each epoch.


A Hash of model training and validation metrics produced by TensorFlow which provides an estimation of the performance of the trained TensorFlow model. The values of the metrics hash keys are arrays that provide a metric for each epoch. The index value plus 1 of the array represents the value for that epoch. Arrays are 0-based, so epoch 0 is the first epoch. The best model, referenced as the OUTPUT_MODEL training property, provides metrics starting at epoch 1 through the best epoch. If the best epoch is 3 and total epochs is 10, metrics for epochs 1, 2, and 3 will be provided. The last model, referenced as the OUTPUT_LAST_MODEL training property, provides a metric for every epoch.


A string with the model type. The value is Object.

NAME (Get)

The name of the model.

NBANDS (Get, Set)

The number of bands in the training rasters.


The number of classes (minus the background class).


Specify the width and height (in pixels) of the patch to use during training. It should be large enough to contain one or more bounding box annotations.


Specify the number of patches to run per batch. A batch comprises one iteration of training; model parameters are adjusted at the end of each iteration. Batches are run in an epoch until the number of patches per epoch is met or exceeded.

URI (Get)

A string that is a fully qualified raster file path.


ERROR (optional)

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See the Manage Errors topic in ENVI Help for more information on error handling.

Version History

Deep Learning 1.2


Deep Learning 3.0

Added METRICS property

See Also

TrainTensorFlowObjectModel Task, TensorFlowObjectClassification Task, BuildObjectDetectionRasterFromAnnotation Task, ENVIDeepLearningObjectDetectionRaster