Sign in Get started

Models

List trained CV models in your organization and download their ONNX weights.

View as Markdown

Models are produced by training runs. The SDK doesn’t insert model rows directly — you train, then read.

from pictograph import Client
client = Client()

list / iter

models = client.models.list(limit=20)
for m in models:
    print(m.name, m.architecture, m.status, m.metrics)

# Or auto-page:
for m in client.models.iter(page_size=50):
    print(m.id, m.model_type)
ArgTypeDefaultNotes
limitint50Backend cap: 500
statusModelStatus | NoneNone"training" / "ready" / "failed" / "archived"
model_typeModelType | NoneNone"object_detection" / "semantic_segmentation" / "instance_segmentation" / "classification"

get

model = client.models.get("model-uuid")
print(model.architecture, model.metrics["mAP"], model.class_mapping)

Returns Model. Inspect metrics (mAP, precision, recall) and class_mapping (index → class name) for inference setup.

download

Stream the ONNX weights to a local file. Only status="ready" models are downloadable — training / failed raise 409 ConflictError.

from pathlib import Path

client.models.download("model-uuid", output_path=Path("./yolox.onnx"))
ArgType
model_idstr
output_pathstr | Path

The download is chunked and checksummed against the object MD5. Safe for multi-GB models.

delete

client.models.delete("model-uuid")

Soft-delete (sets status="archived"). Weights are not purged on soft-delete — contact support to permanently remove them.

Status lifecycle

statusMeaning
trainingTraining is in progress; download returns 409.
readyTrained successfully; weights downloadable via download().
failedTraining stopped with an error. Inspect the source TrainingRun.error_message.
archivedSoft-deleted. Hidden from list() unless status="archived" filter passed.

Inference

The SDK ships read access only — there is no client.models.infer() endpoint in v1.0.0. To run inference, download the ONNX file and use your own runtime (onnxruntime, tensorrt, etc.):

import onnxruntime as ort

client.models.download(model.id, output_path="./model.onnx")
session = ort.InferenceSession("./model.onnx")
# … standard ORT inference loop

The image_inference credit operation (~1 cr/image) reserved for a future managed inference endpoint — not yet exposed.

Common errors

StatusExceptionCause
404NotFoundErrormodel_id missing or belongs to another org
409ConflictErrordownload on a non-ready model
Copied to clipboard