|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://marine-imaging.com/fair/schemas/annotation-v2.0.0.json", |
| 4 | + "title": "Annotations of images", |
| 5 | + "description": "A schema to establish a format for annotations within images (photos and videos) of different shape and by different annotators", |
| 6 | + "type": "object", |
| 7 | + "properties": { |
| 8 | + "image-annotation-labels": { |
| 9 | + "description": "All the labels used in the image-annotations. Specified by an id (e.g. AphiaID), a human-readable name and an optional description.", |
| 10 | + "type": "array", |
| 11 | + "items": { |
| 12 | + "$ref": "#/$defs/label" |
| 13 | + } |
| 14 | + }, |
| 15 | + "image-annotation-creators": { |
| 16 | + "description": "All the annotators that created image-annotations. Specified by an id (e.g. ORCID), a human-readable name and an optional type specifying the annotator's expertise.", |
| 17 | + "type": "array", |
| 18 | + "items": { |
| 19 | + "$ref": "#/$defs/annotator" |
| 20 | + } |
| 21 | + }, |
| 22 | + "image-annotations": { |
| 23 | + "description": "This field stores all annotations as a list of dictionaries of 3-4 fields: shape, coordinates, labels and (optional) frames. See further explanations below. The list of labels specifies the IDs or names of objects and annotators and their confidence. These should be specified in an `image-annotation-labels` and `image-annotation-creators` field (see above) to provide more information on the values used in these fields.", |
| 24 | + "type": "array", |
| 25 | + "items": { |
| 26 | + "type": "object", |
| 27 | + "properties": { |
| 28 | + "shape": { |
| 29 | + "description": "The annotation shape is specified by a keyword (allowed values: see enum).", |
| 30 | + "type": "string", |
| 31 | + "enum": [ |
| 32 | + "single-pixel", |
| 33 | + "polyline", |
| 34 | + "polygon", |
| 35 | + "circle", |
| 36 | + "rectangle", |
| 37 | + "ellipse", |
| 38 | + "whole-image" |
| 39 | + ] |
| 40 | + }, |
| 41 | + "coordinates": { |
| 42 | + "description": "The pixel coordinates of one annotation. The top-left corner of an image is the (0,0) coordinate. The x-axis is the horizontal axis. Pixel coordinates may be fractional. Coordinates are to be given as a list of lists (only one element for photos, optionally multiple elements for videos). The required number of pixel coordinates is defined by the shape (0 for whole-image, 2 for single-pixel, 3 for circle, 8 for ellipse/rectangle, 4 or more for polyline, 8 or more for polygon). The third coordinate value of a circle defines the radius. The first and last coordinates of a polygon must be equal. Format: [[p1.x,p1.y,p2x,p2.y,...]..]", |
| 43 | + "type": "array", |
| 44 | + "items": { |
| 45 | + "type": "array", |
| 46 | + "items": { |
| 47 | + "type": "number" |
| 48 | + } |
| 49 | + } |
| 50 | + }, |
| 51 | + "labels": { |
| 52 | + "description": "The list of labels assigned to annotations by annotators", |
| 53 | + "type": "array", |
| 54 | + "items": { |
| 55 | + "$ref": "#/$defs/annotation-label" |
| 56 | + } |
| 57 | + }, |
| 58 | + "frames": { |
| 59 | + "description": "(only required for video annotations) Frame times (in seconds from the beginning of a video) of a video annotation. Each frame time is linked to one entry in `image-annotations:coordinates` at the same position in the list, which specifies the current coordinates of the annotation at that frame.\nFormat: [f1,...]" |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | + }, |
| 65 | + "$defs": { |
| 66 | + "annotation-label": { |
| 67 | + "type": "object", |
| 68 | + "required": ["label","annotator","created-at"], |
| 69 | + "properties": { |
| 70 | + "label": { |
| 71 | + "description": "A unique identifier to a semantic label", |
| 72 | + "type": "string" |
| 73 | + }, |
| 74 | + "annotator": { |
| 75 | + "description": "A unique identifier to an annotation creator, e.g. orcid URL or handle to ML model", |
| 76 | + "type": "string" |
| 77 | + }, |
| 78 | + "created-at": { |
| 79 | + "description": "The date-time stamp of label creation", |
| 80 | + "type": "string", |
| 81 | + "format": "date-time" |
| 82 | + }, |
| 83 | + "confidence": { |
| 84 | + "description": "A numerical confidence estimate of the validity of the label between 0 (untrustworthy) and 1 (100% certainty)", |
| 85 | + "type": "number" |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + "label": { |
| 90 | + "type": "object", |
| 91 | + "required": ["id","name"], |
| 92 | + "properties": { |
| 93 | + "id": { |
| 94 | + "description": "A unique identifier to a semantic label", |
| 95 | + "type": "string" |
| 96 | + }, |
| 97 | + "name": { |
| 98 | + "description": "A human-readable name for the semantic label", |
| 99 | + "type": "string" |
| 100 | + }, |
| 101 | + "info": { |
| 102 | + "description": "A description on what this semantic label represents", |
| 103 | + "type": "string" |
| 104 | + } |
| 105 | + } |
| 106 | + }, |
| 107 | + "annotator": { |
| 108 | + "type": "object", |
| 109 | + "required": ["id","name"], |
| 110 | + "properties": { |
| 111 | + "id": { |
| 112 | + "description": "A unique identifier to an annotation creator, e.g. orcid URL or handle to ML model", |
| 113 | + "type": "string" |
| 114 | + }, |
| 115 | + "name": { |
| 116 | + "description": "A human-readable name for the annotator (identifying the specific human or machine)", |
| 117 | + "type": "string" |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + } |
| 122 | +} |
0 commit comments