Skip to content

Tools

Pick a pre-defined model and use it with these tools. For this example, we'll use the jetnet.trt_pose.RESNET18_BODY_224X224_TRT_FP16 model.

You can also define your our own model or dataset and use it with these tools as long as it can be imported in Python.

Build

jetnet build is a convenience tool that simply imports the model and calls model.build(). This is useful for testing if a model builds and for generating cached data before using the model elsewhere.

To use it, call jetnet build <model>. For example,

jetnet build jetnet.torchvision.RESNET18_IMAGENET_TRT_FP16
jetnet build jetnet.yolox.YOLOX_NANO_TRT_FP16
jetnet build jetnet.trt_pose.RESNET18_BODY_224X224_TRT_FP16
jetnet build jetnet.easyocr.EASYOCR_EN_TRT_FP16

Profile

jetnet profile profiles a model on real data. It measures the model throughput, as well as other task specific statistics like the average number of objects per image. This is handy, especially for models that may have data-dependent runtime.

To use it, call jetnet profile <model> <dataset>. For example,

jetnet profile jetnet.torchvision.RESNET18_IMAGENET_TRT_FP16 jetnet.coco.COCO2017_VAL_IMAGES

example output:

{
    "fps": 159.50995530176425,
    "avg_image_area": 286686.08
}
jetnet profile jetnet.yolox.YOLOX_NANO_TRT_FP16 jetnet.coco.COCO2017_VAL_IMAGES

example output:

{
    "fps": 161.64499986521764,
    "avg_image_area": 286686.08,
    "avg_num_detections": 3.86
}
jetnet profile jetnet.trt_pose.RESNET18_BODY_224X224_TRT_FP16 jetnet.coco.COCO2017_VAL_IMAGES

example output:

{
    "fps": 103.2494480449782,
    "avg_image_area": 286686.08,
    "avg_num_poses": 1.98,
    "avg_num_keypoints": 16.32
}
jetnet profile jetnet.easyocr.EASYOCR_EN_TRT_FP16 jetnet.textocr.TEXTOCR_TEST_IMAGES

example output:

{
    "fps": 13.334012937781655,
    "avg_image_area": 768962.56,
    "avg_num_detections": 10.48,
    "avg_num_characters": 66.46
}

Demo

jetnet demo peforms inference on live camera images and displays predictions in your web browser. This is especially handy when you're operating on a headless machine.

With a USB camera attached, call jetnet demo <model>. For example,

jetnet demo jetnet.torchvision.RESNET18_IMAGENET_TRT_FP16

Once the demo is running, navigate to http://<ip>:8000 in your web browser to view the predictions.

jetnet demo jetnet.yolox.YOLOX_NANO_TRT_FP16

Once the demo is running, navigate to http://<ip>:8000 in your web browser to view the predictions.

jetnet demo jetnet.trt_pose.RESNET18_BODY_224X224_TRT_FP16

Once the demo is running, navigate to http://<ip>:8000 in your web browser to view the predictions.

jetnet demo jetnet.easyocr.EASYOCR_EN_TRT_FP16

Once the demo is running, navigate to http://<ip>:8000 in your web browser to view the predictions.