MapNet module creates a MapNet handle ( dwMapNetHandle_t
) that is owned by the application and must be released by the application when it's not needed anymore.
dwMapNetParams
records the specs of the MapNet model to be loaded and initialized. These parameters determine which precision, optimized processor, and type of MapNet to be loaded and can affect the speed of the inference greatly. dwMapNetType
defines which type of network to use segmentation based, regressor based or end-to-end network. To initialize MapNet parameters with default values:
To initialize a pointer to MapNet handle with the designated values of dwMapNetParams
call:
An example code snippet to initialize a MapNet module with a customized FP32 MapNet model that is optimized to perform inference on GPU:
Note that dwMapNet_initDefaultParams()
set mapNetParams.networkPrecision
and mapNetParams.processorType
to the default values of DW_PRECISION_FP32
and DW_PROCESSOR_TYPE_GPU
, respectively.
The available choices for network model depend on dwMapNetType
. If the MapNet type is DW_MAPNET_TYPE_E2E
, the supported model is DW_MAPNET_MODEL_FRONT_E2E
. If the MapNet type is DW_MAPNET_TYPE_REGRESSOR
, the supported model is DW_MAPNET_MODEL_FRONT_REGRESSOR
. If the MapNet type is DW_MAPNET_TYPE_SEGMENTATION
, the supported models are DW_MAPNET_MODEL_FRONT_MULTI_CLASS
and DW_MAPNET_MODEL_FRONT_SINGLE_CLASS
.
With the provided APIs, you can get the input blob dimension that the initialized MapNet expects:
or retrieve the pointer to the label of the provided class index:
or even the meta data which contains preprocessing configuration for the network:
Finally, to release the MapNet module at the end of the application: