Back | Next | Contents
Object Detection
To process test images with detectNet
and TensorRT on the Jetson, we can use the detectnet-console
program.
detectnet-console
accepts command-line arguments representing the path to the input image and path to the output image (with the bounding box overlays rendered). Some test images are also included with the repo.
To specify your model that you downloaded from DIGITS in the previous step, use the syntax to detectnet-console
below. First, for convienience, set the path to your extracted snapshot into a $NET
variable:
$ NET=20170504-190602-879f_epoch_100
$ ./detectnet-console dog_0.jpg output_0.jpg \
--prototxt=$NET/deploy.prototxt \
--model=$NET/snapshot_iter_38600.caffemodel \
--input_blob=data \
--output_cvg=coverage \
--output_bbox=bboxes
note: the
input_blob
,output_cvg
, andoutput_bbox
arguments may be omitted if your DetectNet layer names match the defaults above (i.e. if you are using the prototxt from following this tutorial). These optional command line parameters are provided if you are using a customized DetectNet with different layer names.
Alternatively, to load one of the pretrained snapshots that comes with the repo, you can specify the pretrained model name as the 3rd argument to detectnet-console
:
$ ./detectnet-console dog_1.jpg output_1.jpg coco-dog
The above command will process dog_1.jpg, saving it to output_1.jpg, using the pretrained DetectNet-COCO-Dog model. This is a shortcut of sorts so you don't need to wait for the model to complete training if you don't want to.
Below is a table of the pretrained DetectNet snapshots downloaded with the repo (located in the data/networks
directory after running cmake
step) and the associated argument to detectnet-console
used for loading the pretrained model:
DIGITS model | CLI argument | classes |
---|---|---|
DetectNet-COCO-Airplane | coco-airplane |
airplanes |
DetectNet-COCO-Bottle | coco-bottle |
bottles |
DetectNet-COCO-Chair | coco-chair |
chairs |
DetectNet-COCO-Dog | coco-dog |
dogs |
ped-100 | pednet |
pedestrians |
multiped-500 | multiped |
pedestrians, luggage |
facenet-120 | facenet |
faces |
These all also have the python layer patch above already applied.
Let's try running some of the other COCO models. The training data for these are all included in the dataset downloaded above. Although the DIGITS training example above was for the coco-dog model, the same procedure can be followed to train DetectNet on the other classes included in the sample COCO dataset.
$ ./detectnet-console bottle_0.jpg output_2.jpg coco-bottle
$ ./detectnet-console airplane_0.jpg output_3.jpg coco-airplane
Included in the repo are also DetectNet models pretrained to detect humans. The pednet
and multiped
models recognized pedestrians while facenet
recognizes faces (from FDDB). Here's an example of detecting multiple humans simultaneously in a crowded space:
$ ./detectnet-console peds-004.jpg output-4.jpg multiped
When using the multiped model (PEDNET_MULTI
), for images containing luggage or baggage in addition to pedestrians, the 2nd object class is rendered with a green overlay.
$ ./detectnet-console peds-003.jpg output-3.jpg multiped
Next, we'll run object detection on a live camera stream.
Next | Running the Live Camera Detection Demo
Back | Downloading the Detection Model to Jetson
© 2016-2019 NVIDIA | Table of Contents