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
Complete the quickstart here.
Choose one of the DetectNet model that is listed here
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. Theinput/dims
should be the size of the raw input images. It can be different for the same model. Theoutput/dims
dimensions can be calculated asround(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 hereRun the following command with the required input parameters:
ros2 run isaac_ros_detectnet setup_model.sh --height 720 --width 1280 --config-file isaac_sim_config.pbtxt
Parameters:
--model-link
: Get thewget
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_v2.5/zip
--model-file-name
: The name of the.etlt
file found in the file browser tab of the model page. e.g.:resnet34_peoplenet_int8.etlt
--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
Replace lines 32 and 33 in isaac_ros_detectnet.launch.py with the input image dimensions
Run the following command:
cd /workspaces/isaac_ros-dev && \ ros2 launch isaac_ros_detectnet isaac_ros_detectnet.launch.py