Tutorial for DetectNet with a Custom Model

Overview

This tutorial walks you through how to use a different DetectNet Model with isaac_ros_detectnet for object detection.

Tutorial Walkthrough

  1. Complete the quickstart here.

  2. Choose one of the DetectNet model that is listed here

  3. Create a config file. Use ${ISAAC_ROS_WS}/isaac_ros_assets/models/peoplenet/quickstart_config.pbtxt as a template. The datatype can be found in the overview tab of the model page. The input/dims should be the size of the raw input images. It can be different for the same model. The output/dims dimensions can be calculated as round(input_dims/max_batch_size). Place this config file in the ${ISAAC_ROS_WS}/isaac_ros_assets/models/<model_name> directory. You can find more information about the config file here

  4. Run the following command with the required input parameters:

    ros2 run isaac_ros_detectnet setup_model.sh --config-file peoplenet_config.pbtxt
    

    Parameters:

    --model-link : Get the wget link to the specific model version under the file browser tab in the page. Click on the download button on the top right and select WGET. This will copy the commend to you clipboard. Paste this in a text editor and extract only the hyperlink. e.g.: https://api.ngc.nvidia.com/v2/models/nvidia/tao/peoplenet/versions/deployable_quantized_onnx_v2.6.3/zip

    --model-file-name : The name of the .onnx file found in the file browser tab of the model page. e.g.: resnet34_peoplenet.onnx

    --height : height dimension of the input image e.g.: 632

    --width : width dimension of the input image. e.g.: 1200

    --config-file : name of config file mentioned in step 3. Located at ${ISAAC_ROS_WS}/isaac_ros_assets/models/<model_name> e.g.: peoplenet_config.pbtxt

    -precision : type/precision of model found in the overview tag of the model page. e.g.: int8

    --output-layers: output layers separated by commas that can be found from the .txt file in the file browser tab of the model page. e.g.: output_cov/Sigmoid,output_bbox/BiasAdd

  5. Replace lines 32 and 33 in isaac_ros_detectnet.launch.py with the input image dimensions

  6. Run the following command:

    cd /workspaces/isaac_ros-dev && \
      ros2 launch isaac_ros_detectnet isaac_ros_detectnet.launch.py