{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Talo annotation file, demonstration schema v0.3",
  "type": "object",
  "required": [
    "sample_id",
    "schema_version",
    "task",
    "clip",
    "bbox_format",
    "tracks",
    "segments"
  ],
  "properties": {
    "sample_id": {
      "type": "string"
    },
    "schema_version": {
      "type": "string"
    },
    "task": {
      "type": "object",
      "required": [
        "name",
        "description"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string",
          "description": "Natural-language task description."
        }
      }
    },
    "clip": {
      "type": "object",
      "required": [
        "duration_s",
        "fps",
        "width",
        "height"
      ],
      "properties": {
        "duration_s": {
          "type": "number"
        },
        "fps": {
          "type": "number"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "modality": {
          "type": "string"
        },
        "view": {
          "type": "string"
        },
        "file": {
          "type": "string"
        }
      }
    },
    "bbox_format": {
      "const": "xywh_pixels"
    },
    "interpolation": {
      "enum": [
        "linear",
        "none"
      ]
    },
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "label",
          "keyframes"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "keyframes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "t",
                "bbox"
              ],
              "properties": {
                "t": {
                  "type": "number",
                  "description": "Seconds from clip start."
                },
                "bbox": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 4,
                  "maxItems": 4
                }
              }
            }
          }
        }
      }
    },
    "segments": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "start_s",
          "end_s",
          "action"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "start_s": {
            "type": "number"
          },
          "end_s": {
            "type": "number"
          },
          "action": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      }
    },
    "provenance": {
      "type": "string"
    },
    "review": {
      "type": "object",
      "description": "Review method, corrections made and known limits.",
      "properties": {
        "method": {
          "type": "string"
        },
        "independent": {
          "type": "boolean"
        },
        "frames_checked": {
          "type": "integer"
        },
        "checked_t": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "Seconds from clip start of each frame checked in the second pass."
        },
        "threshold_px": {
          "type": "number"
        },
        "corrections": {
          "type": "array"
        },
        "limits": {
          "type": "string"
        }
      }
    },
    "permitted_use": {
      "type": "string"
    },
    "demonstration": {
      "type": "boolean"
    },
    "not_included": {
      "type": "string"
    },
    "instructions": {
      "type": "object",
      "description": "Annotation instructions the labels were made to."
    }
  }
}
