Skip to main content

Model export

Triton serves TensorRT engines from models/<name>/1/ with a config.pbtxt beside them. Engines are compiled on your GPU, once; Triton loads the cached .plan files on every later start. scripts/setup.sh runs the core exports for you. This page covers doing it by hand with the Makefile targets, and the models setup.sh does not build (PE-Core for curation).

Every target below runs inside the running api container (docker compose -p <project> exec api ...), so start the core stack first (make up). On an installed directory, use ./openprocessor models install [--only GROUP] instead of these targets (groups: preflight, base, yolo, mobileclip, faces, ocr, pe). Weights you download land in pytorch_models/, which the API container mounts.

What Triton loads by default​

triton-server runs in explicit model-control mode with --exit-on-error=false, so a missing engine leaves that one model unloaded instead of stopping the server. The default --load-model list in docker-compose.yml:

ModelPurpose
yolov11_small_trt_end2endObject detection (TensorRT + EfficientNMS, normalized boxes)
scrfd_10g_bnkpsFace detection + 5-point landmarks
arcface_w600k_r50Face embedding, 512-dim
mobileclip2_s2_image_encoder, mobileclip2_s2_text_encoderCLIP image/text embeddings, 512-dim
paddleocr_det_trt, paddleocr_rec_trtPP-OCRv5 text detection / recognition
ocr_pipelineOCR orchestration (Triton Python backend, BLS)
pe_image_encoderPE-Core image embedding, 1024-dim (curation)
pe_text_encoderPE-Core text embedding for semantic search (ONNX Runtime, CPU)

Core models​

StepTargetWhat it does
Base weightsmake download-modelsFetches yolo11s.pt, scrfd_10g_bnkps.onnx, arcface_w600k_r50.onnx and mobileclip_s2.pt into pytorch_models/
YOLO11 detectionmake export-modelsExports YOLO11 small to TensorRT and to a TensorRT end2end engine (EfficientNMS, GPU NMS, normalized boxes), writes labels.txt and config.pbtxt
Facesmake setup-face-pipelinedownload-face-models, export-face-recognition (ArcFace) and export-scrfd (SCRFD-10G), then loads both
CLIP embeddingsmake export-mobileclipExports the MobileCLIP image and text encoders, then restarts Triton
OCRmake setup-ocrdownload-paddleocr (PP-OCRv5 ONNX + dictionaries), export-paddleocr (det + rec to TensorRT), then restarts Triton

make export-small is the same as export-models; make export-all builds nano through xlarge in every format, which takes a long time. make export-status, make validate-exports and make models-list show what exists and what Triton has loaded.

Export is a one-time cost per GPU model; engines are cached on disk, so later starts take seconds to a minute. A full first install, pulls and engine builds together, typically takes 30-60 minutes. Per-model times vary with the card, so time them on yours.

YOLO26 alongside YOLO11​

YOLO26 uses the stock Ultralytics exporter and produces a natively NMS-free, single-tensor engine (no plugin). One Triton instance serves both families; the API reads each model's output format from Triton metadata.

docker compose -p openprocessor exec api python /app/export/export_yolo26.py --models small
curl -X POST http://localhost:4603/models/yolo26_small_trt/load
curl -X POST "http://localhost:4603/detect?model_name=yolo26_small_trt" -F "image=@photo.jpg"

Set YOLO_MODEL=yolo26_small_trt to make it the default detector. Models load and unload at runtime through POST /models/{name}/load and POST /models/{name}/unload.

PE-Core encoders (required for curation)​

Curation stores a 1024-dim pe_embedding per item from Meta's PE-Core-L14-336. Semantic search, near-duplicate detection, residual clustering and the embedding plot all run on it. The Triton model names are fixed: pe_image_encoder (TensorRT, input images [B,3,336,336], output image_embeddings [B,1024]) and pe_text_encoder (ONNX Runtime, one CPU instance, 0 GB of GPU memory). Both are already in Triton's --load-model list in docker-compose.yml.

make export-pe

export-pe chains:

TargetStep
make pe-downloadDownload and SHA-256 verify the pinned checkpoint into the HuggingFace cache (the repo is not gated)
make pe-export-imageImage tower to pytorch_models/pe_image_encoder.onnx
make pe-build-trtBuild the TensorRT plan in models/pe_image_encoder
make pe-export-text-tritonExport the text tower (parity-gated against PyTorch) and install it as Triton's pe_text_encoder

It then restarts Triton; restart api afterwards. If the TensorRT build fails on PE's attention-pool ops, run make pe-build-ort to serve the image ONNX through Triton's ONNX Runtime backend instead. make pe-text-status (GET /health/pe_text) shows which text backend the API is using: with OP_PE_TEXT_BACKEND=auto it uses an in-process ONNX Runtime session when OP_PE_TEXT_ONNX_PATH exists, else Triton's shared CPU instance if it is ready, else a lazily loaded in-process PyTorch encoder.

Your own models​

TargetUse
make export-custom MODEL=/app/pytorch_models/my.pt [NAME=...] [BATCH=32]Export your own YOLO checkpoint
make export-config CONFIG=/path/to/config.yamlBatch export from a YAML config
make export-dual-head MODEL=... NAME=...Export a detector with an extra sppf_feat feature-map output, pooled per detection into the curation backbone_embedding
POST /models/upload, POST /models/{name}/exportUpload and export through the API instead of the CLI

A training run you promote from the curation subsystem is written into the model repository and loaded for you. The model is named for the project that trained it ({slug}__<name>; default has no prefix), and other projects can use it only after it is shared; see Training, bake-off and promote. Weight licenses differ per model; read Licenses before any commercial use.