Skip to content

Type to search titles, section headings and summaries across the Developer Portal.

↑ ↓ to move · Enter to open · Esc to close · searched locally in your browser

Reference

Code Examples

Illustrative dataset manifests, annotation structures, scenario and evaluation configurations, reports and a dataset lifecycle, in JSON, Python and TypeScript.

Page type: Structured details: fields, formats, statuses.

Dataset manifest

The manifest, a TypeScript type for it, and a validator you can run with any Python 3.9+ installation.
dataset_manifest.jsonIllustrative
{
  "dataset_id": "example-maize-weed-seg",
  "dataset_version": "1.0.0",
  "created_at": "2026-01-15T09:00:00Z",
  "license": "CC-BY-4.0",
  "task_type": "semantic-segmentation",
  "annotation_format": "png-indexed-masks",
  "classes": [
    "soil",
    "crop",
    "weed"
  ],
  "scenario_reference": "scenarios/maize-weed-overcast-v1.json",
  "sample_count": 240,
  "splits": {
    "train": 168,
    "validation": 36,
    "test": 36
  },
  "provenance": {
    "source": "synthetic",
    "generator": "illustrative-example",
    "seed": 1234
  }
}
Run the validator
python validate_manifest.py dataset_manifest.json

Example output

Manifest OK: example-maize-weed-seg 1.0.0 (240 samples)

Segmentation annotation structure

A COCO-style record for one weed instance: polygon, bounding box and area.
annotations.jsonIllustrative
{
  "images": [
    {
      "id": 17,
      "file_name": "images/field_000017.png",
      "width": 640,
      "height": 480
    }
  ],
  "categories": [
    {
      "id": 1,
      "name": "crop"
    },
    {
      "id": 2,
      "name": "weed"
    }
  ],
  "annotations": [
    {
      "id": 301,
      "image_id": 17,
      "category_id": 2,
      "segmentation": [
        [
          212,
          96,
          231.5,
          94,
          238,
          110.5,
          220,
          118,
          209.5,
          108
        ]
      ],
      "bbox": [
        209.5,
        94,
        28.5,
        24
      ],
      "area": 471.25,
      "iscrowd": 0
    }
  ]
}

Scenario configuration

Generated with the same logic as the scenario explorer in the Simulation Engine guide.
scenarios/agricultural-dusk-clear.jsonIllustrative
{
  "scenario_id": "example-agricultural-dusk-clear",
  "version": "0.1.0",
  "environment": {
    "type": "agricultural",
    "objects": [
      "crop rows",
      "weeds",
      "soil",
      "field machinery"
    ]
  },
  "lighting": {
    "time_of_day": "dusk"
  },
  "weather": {
    "condition": "clear"
  },
  "agents": {
    "behaviour": "a slow-moving field vehicle"
  },
  "sensors": [
    {
      "id": "sensor_0",
      "type": "rgb_camera",
      "resolution": [
        1280,
        720
      ],
      "fov_deg": 90,
      "frame_rate_hz": 10
    }
  ],
  "random_seed": 1234,
  "output": {
    "frames": 200,
    "task": "semantic-segmentation",
    "annotations": [
      "semantic_mask"
    ]
  }
}

Evaluation configuration

experiments/EXP-SAMPLE-014.jsonIllustrative
{
  "experiment_id": "EXP-SAMPLE-014",
  "model_reference": {
    "name": "example-segmentation-model",
    "version": "0.3.0",
    "checkpoint_sha256": "<recorded at run time>"
  },
  "dataset_reference": "example-maize-weed-seg",
  "dataset_version": "1.0.0",
  "evaluation_protocol": {
    "split": "test",
    "held_out_real_data": true,
    "resize": [
      512,
      512
    ],
    "threshold": 0.5
  },
  "metrics": [
    "iou",
    "dice",
    "precision",
    "recall"
  ],
  "scenario_groups": [
    "clear-day",
    "overcast",
    "dusk",
    "dense-weeds"
  ],
  "random_seed": 1234
}

Experiment report

A machine-readable report. All values are sample data, flagged by sample_data: true.
evaluation/EXP-SAMPLE-014-report.jsonSample data
{
  "experiment_id": "EXP-SAMPLE-014",
  "sample_data": true,
  "summary": "Illustrative report layout. Values are sample data, not results.",
  "dataset": {
    "reference": "example-maize-weed-seg",
    "version": "1.0.0",
    "split": "test"
  },
  "model": {
    "name": "example-segmentation-model",
    "version": "0.3.0"
  },
  "conditions": [
    "clear-day",
    "overcast",
    "dusk",
    "dense-weeds"
  ],
  "metrics": {
    "overall": {
      "iou": 0.71,
      "dice": 0.83
    },
    "by_condition": {
      "clear-day": {
        "iou": 0.76,
        "dice": 0.86
      },
      "overcast": {
        "iou": 0.72,
        "dice": 0.84
      },
      "dusk": {
        "iou": 0.63,
        "dice": 0.77
      },
      "dense-weeds": {
        "iou": 0.6,
        "dice": 0.75
      }
    }
  },
  "failure_categories": [
    {
      "category": "weed missed under crop canopy",
      "count": 14
    },
    {
      "category": "soil texture labelled as weed",
      "count": 9
    },
    {
      "category": "boundary error at row edges",
      "count": 21
    }
  ],
  "limitations": [
    "Sample values only.",
    "Single seed; no confidence intervals.",
    "No real-world field validation."
  ],
  "next_experiments": [
    "Add dusk and dense-weed scenarios to the training data.",
    "Repeat with three seeds.",
    "Validate on held-out real field images."
  ]
}

End-to-end dataset lifecycle

The intended lifecycle in one place, as pseudocode.
lifecycle (pseudocode)Pseudocode
# PSEUDOCODE: illustrative only. These functions are NOT provided by any
# released Synthex package or API; they name the intended lifecycle stages.

requirements = describe_task(task="semantic-segmentation", classes=["soil", "crop", "weed"])
scenario = configure_scenario(environment="agricultural", lighting="overcast", seed=1234)

samples = generate_or_acquire(scenario, frames=240)
annotations = prepare_annotations(samples, format="png-indexed-masks")
report = run_quality_checks(samples, annotations)  # missing files, invalid classes, duplicates

if report.passed:
    manifest = package_dataset(samples, annotations, version="1.0.0", license="CC-BY-4.0")
    # Training happens in your own environment, with your own framework.
    results = evaluate(model_reference, manifest, protocol="held-out-real-test")
    next_scenarios = refine_scenarios(results.failure_categories)
Not executable against any Synthex package: the functions name lifecycle stages only.

Each stage is explained in the engine guides: