Polygon (v5)¶
Previous Version: v4
Shortname:
PolygonInherits from: Region (v5)
Also Known As: This type is also accessible at the following legacy URLs for backward compatibility:
Description¶
A polygon in an image or video. This is a two-dimensional object so if this occurs in a video it will be anchored to a particular frame or time point in the video.
Properties¶
Synopsis¶
Properties marked with * are required.
Property |
Type |
Origin |
|---|---|---|
array of array |
native |
|
integer |
native |
|
string |
||
object |
||
object |
||
string |
||
string |
||
array of string |
||
string |
||
id * |
string |
Native¶
coordinates¶
type: array of array
required: yes
The coordinates of the polygon, taking the top-left of the image as the origin (0,0). Unit used to measure the distance is the number of pixels.
timePoint¶
type: integer
required: no
If on a video stream, the TimePoint that the BoundingBox occurs in.
Inherited from Region (v5)¶
timeUnit¶
type: string
required: no
Specifies which unit of time the measurement is based. Can be seconds or milliseconds, or in case of annotations on a VideoDocument, frames. If not specified, milliseconds (in whole numbers) is assumed.
Note
This metadata is only relevant for time-based annotations.
Inherited from Annotation (v6)¶
classification¶
type: object
required: no
A map from label values to their “score” numbers provided by a classifier. The score can be probability, similarity, confidence, or any other real number that was used to determine the label value.
Optional on top of the label property. However when this property is used, the label property must be one of the keys and the keys must match to the values defined in the labelset or labelsetUri annotation metadata.
classifications¶
type: object
required: no
Alias for the classification metadata. Here for historical reasons.
document¶
type: string
required: no
The identifier of the document that the annotation is over.
label¶
type: string
required: no
A label given to this object by classification. The value must be a simple string value of the label and must be one of the values defined in the labelset or labelsetUri annotation metadata.
For example, for the Sentence subtype, this could be used to indicate the type of sentence, such as “declarative”, “interrogative”, “exclamatory”, etc. For NamedEntity subtype, this could be used to indicate the type of named entity, such as “PER”, “ORG”, “LOC”, “MISC” (following the CoNLL-2003 labels).
For non-linguistic annotations, for example for TimeFrame, this could be used to indicate the type of the time frame, such as “speech”, “music”, “noise”, “bars-and-tones”, etc, for acoustic classification. Or “slate”, “lower-third”, “credits” for visual classification of video frames.
Note
Annotations from a type of classifier model must have this property.
labelset¶
type: array of string
required: no
When an annotation object contains results of a classification task, this metadata is used to specify the label values used in classification. Individual annotations then must have label property that is one of the values in this list.
Note
Annotations from a classifier app must have this metadata or labelsetUri metadata.
Note
Not all of labels specified in the labelset must occur in the output annotations. For example, a labelset can contain a catch-all negative label, but if the negative label can be not interesting enough to keep in the output annotation.
labelsetUri¶
type: string
required: no
A URI to an externally defined labelset. Since the labelset metadata is a list of simple strings, this URI can be used to point to a more detailed definition of the labelset. This can be a JSON-LD document or a SKOS concept scheme, for example.
Note
Annotations from a classifier app must have this metadata or labelset metadata.
Inherited from Thing (v1)¶
id¶
type: string
required: yes
A unique identifier for the annotation or document. Uniqueness is relative to the view the annotation is in or the list of documents at the top level of a MMIF file.
JSON Schema¶
{
"additionalProperties": true,
"properties": {
"id": {
"description": "A unique identifier for the annotation or document. Uniqueness is relative to the view the annotation is in or the list of documents at the top level of a MMIF file.",
"type": "string"
},
"document": {
"type": "string",
"description": "The identifier of the document that the annotation is over."
},
"labelset": {
"items": {
"type": "string"
},
"type": "array",
"description": "When an annotation object contains results of a classification task, this metadata is used to specify the label values used in classification. Individual annotations then must have <code>label</code> property that is one of the values in this list. <br><br> [note] Annotations from a classifier app must have this metadata or <code> labelsetUri </code> metadata. [/note]<br><br> [note] Not all of labels specified in the <code>labelset</code> must occur in the output annotations. For example, a <code>labelset</code> can contain a <i>catch-all</i> negative label, but if the negative label can be not interesting enough to keep in the output annotation. [/note]"
},
"labelsetUri": {
"type": "string",
"description": "A URI to an externally defined labelset. Since the <code>labelset</code> metadata is a list of simple strings, this URI can be used to point to a more detailed definition of the labelset. This can be a JSON-LD document or a SKOS concept scheme, for example. <br><br> [note] Annotations from a classifier app must have this metadata or <code> labelset </code> metadata. [/note]"
},
"label": {
"type": "string",
"description": "A label given to this object by classification. The value must be a simple string value of the label and must be one of the values defined in the <code>labelset</code> or <code>labelsetUri</code> annotation metadata. <br><br> For example, for the <code>Sentence</code> subtype, this could be used to indicate the type of sentence, such as \"declarative\", \"interrogative\", \"exclamatory\", etc. For <code>NamedEntity</code> subtype, this could be used to indicate the type of named entity, such as \"PER\", \"ORG\", \"LOC\", \"MISC\" (following the CoNLL-2003 labels). <br><br> For non-linguistic annotations, for example for <code>TimeFrame</code>, this could be used to indicate the type of the time frame, such as \"speech\", \"music\", \"noise\", \"bars-and-tones\", etc, for acoustic classification. Or \"slate\", \"lower-third\", \"credits\" for visual classification of video frames. <br><br> [note] Annotations from a type of classifier model must have this property. [/note]"
},
"classifications": {
"additionalProperties": {
"type": "number"
},
"type": "object",
"description": "Alias for the <code>classification</code> metadata. Here for historical reasons."
},
"classification": {
"additionalProperties": {
"type": "number"
},
"type": "object",
"description": "A map from label values to their \"score\" numbers provided by a classifier. The score can be probability, similarity, confidence, or any other real number that was used to determine the label value. <br><br> <i>Optional</i> on top of the <code>label</code> property. However when this property is used, the <code>label</code> property must be one of the keys and the keys must match to the values defined in the <code>labelset</code> or <code>labelsetUri</code> annotation metadata."
},
"timeUnit": {
"type": "string",
"description": "Specifies which unit of time the measurement is based. Can be *seconds* or *milliseconds*, or in case of annotations on a VideoDocument, *frames*. If not specified, *milliseconds* (in whole numbers) is assumed. <br><br> [note] This metadata is only relevant for time-based annotations. [/note]"
},
"coordinates": {
"description": "The coordinates of the polygon, taking the top-left of the image as the origin (0,0). Unit used to measure the distance is the number of pixels.",
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
"timePoint": {
"type": "integer",
"description": "If on a video stream, the TimePoint that the BoundingBox occurs in."
}
},
"required": [
"coordinates",
"id"
],
"type": "object"
}