Faster RCNN with TAO Deploy#
To generate an optimized TensorRT engine for Faster RCNN, the gen_trt_engine action takes
an ONNX file previously produced by the Faster RCNN export action. For more information
about training the Faster RCNN, refer to the
Faster RCNN training documentation.
Converting .onnx File into TensorRT Engine#
You can reuse the spec from the Faster RCNN export action as a starting point.
Note
When generating a TensorRT engine for a model trained with QAT enabled, the tensor
scale factors defined by the calibration cache file are required. However, the current
version of QAT does not natively support DLA int8 deployment on Jetson. To deploy this model
on a Jetson with DLA int8, force post-training quantization to generate the calibration
cache file.
Ask the agent to run the gen_trt_engine action against your spec. For example:
Build an INT8 TensorRT engine for Faster RCNN from the exported ONNX at
``s3://my-bucket/frcnn/model.onnx`` using ``trt-spec.yaml``. Calibrate
against ``s3://my-bucket/frcnn/cal-images/`` and write the engine to
``s3://my-bucket/frcnn/int8.engine``. Run on local Docker.
Running Evaluation through TensorRT Engine#
Use the same specification file as the TAO evaluation specification file.
Ask the agent to run the evaluate action against the engine you built. For example:
Evaluate the Faster RCNN TensorRT engine at
``s3://my-bucket/frcnn/int8.engine`` against ``eval-spec.yaml``. Run on
local Docker.
Running Inference through TensorRT Engine#
Ask the agent to run the inference action against the engine you built. For example:
Run Faster RCNN inference with the TensorRT engine at
``s3://my-bucket/frcnn/int8.engine`` using ``infer-spec.yaml``. Run on
your chosen backend.
Annotated visualizations are written to images_annotated under the configured results
directory, and KITTI-format predictions are written to labels.