How do I train YOLOX and export it to ONNX?
Train a YOLOX object detection model on Pictograph and you get an ONNX artifact you can run anywhere. Annotate or import a dataset, call one training function, and download the .onnx file when the run completes. The training runs on managed GPUs, so there is no CUDA setup, no Colab timeout, and no GPU droplet to babysit.
from pictograph import Client
client = Client()
# Build the export, then train it on a managed GPU
client.exports.create(
dataset_name="road-signs",
name="road-signs-v1",
format="pictograph",
include_images=True,
wait=True,
)
run = client.training.create(
dataset_name="road-signs",
export_name="road-signs-v1",
pipeline_type="yolox",
name="road-signs-detector",
gpu_type="a10g",
)
client.models.download(
model_id=run.model_id,
output_path="road_signs.onnx",
)
What you need first
- A dataset with bounding box annotations. Label it by hand, with SAM3 auto-annotation, or import it from V7 or Roboflow.
- At least a handful of images per class so the train, validation, and test split is meaningful.
Step by step
- Prepare the dataset. Annotate objects as bounding boxes, since YOLOX is a detector.
- Build an export, then call
client.training.createon it. Training is always on an export, so you can see exactly what went into the run. Pickgpu_type="a10g"for most datasets or"a100"for larger ones. - Track progress. The run reports per-epoch progress; the call returns once the model is ready.
- Download the ONNX model.
client.models.download(model_id=..., output_path="...onnx")writes the artifact locally.
A note on naming and output
This is YOLOX, an Apache-2.0 object detection architecture. It is not Ultralytics YOLO, and Pictograph does not impose Ultralytics licensing on your model. The training output is a standard ONNX file, so you can run it with onnxruntime, convert it for an edge target, or serve it directly.
Deploy it in one click
Once you have a trained model, you can stand it up as an always-on endpoint without leaving Pictograph:
created = client.deployments.create(
model="road-signs-detector",
gpu_type="t4",
)
print(created.deployment.endpoint_url) # one authenticated /predict URL
print(created.auth_token) # pk_deploy_… shown ONCE
See training for the full architecture list and deployments for serving the result.