YOLOv4-tiny with TAO Deploy#
To generate an optimized TensorRT engine for YOLOv4-tiny, the gen_trt_engine action takes
an ONNX file previously produced by the YOLOv4-tiny export action. For more information
about training the YOLOv4-tiny, refer to the
YOLOv4-tiny training documentation.
Converting .onnx File into TensorRT Engine#
You can reuse the spec from the YOLOv4-tiny 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 YOLOv4-tiny from the exported ONNX at
``s3://my-bucket/yolov4-tiny/model.onnx`` using ``trt-spec.yaml``.
Calibrate against ``s3://my-bucket/yolov4-tiny/cal-images/`` and write
the engine to ``s3://my-bucket/yolov4-tiny/int8.engine``. Run on the local Docker backend.
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 YOLOv4-tiny TensorRT engine at
``s3://my-bucket/yolov4-tiny/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 YOLOv4-tiny inference with the TensorRT engine at
``s3://my-bucket/yolov4-tiny/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.