Fisheye GPU analysis
This example demonstrates the onboard GPU capabilities of CG2. It is not recommended for Flight Model (FM) use: the ResNet weights are large and FM uplink bandwidth is limited.
This advanced example fetches explicitly selected fisheye images from the onboard telemetry API, performs CUDA-accelerated analysis, and writes insights for a separate downlink task. Create the operation and execution with the dashboard or maintained API client; legacy EM API calls are not part of this workflow.
Required assets
The example uses Dockerfile, fisheye.py, and
resnet18-f37072fd.pth. The Python code loads the checkpoint from
/data/resnet18-f37072fd.pth, so uplink it to the selected payload volume
before the pod starts. The checkpoint is 44.7 MiB; lossless compression reduces
it only to roughly 41 MiB and adds an extraction requirement.
Download the required assets:
The main.py file in that directory uses the retired EM API and is retained only
as historical source material; do not use it for this workflow.
Workflow
- Upload the source files and model checkpoint to a namespace.
- Uplink them to
/fisheyeinpayload. The pod sees that volume at/data. - Build the image from an image available to the target environment and run the
analysis pod with
node: GPU,volume: payload, and an explicitmax_duration. - Persist
cuda_insights.jsonandlog.txtbelow/data/fisheye, then add a separate downlink task to retrieve them to the namespace.
Use the Engineering Model (EM) to validate the exact runtime image, model, GPU availability, and bundle. Image availability, GPU scheduling, image ordering, freshness, and runtime are not guaranteed by this reference.
Smaller model option
An INT8 ResNet-18 artifact can be about 11–12 MiB, but it requires a compatible quantized/TorchScript or ONNX runtime and code changes; it cannot be substituted for the current FP32 checkpoint directly.