Skip to content

annosaurus 0.5.1

Compare
Choose a tag to compare
@hohonuuli hohonuuli released this 30 Oct 16:25
· 345 commits to master since this release
5e5497b

Improved bulk create/delete methods.

Create

Allows users to bulk insert annotations into annosaurus as JSON. We've tested this up to about 5000 annotations at once. Note that annosaurus will handle large bulk inserts, but be aware most clients will timeout while waiting for the insert to complete. (The results is that the annotations do get inserted though).

Endpoint

/anno/v1/annotations/bulk

Example

POST /anno/v1/annotations/bulk
Content-Type: application/json
Authorization: Bearer <jwt access token>

[
  {
    "observation_uuid": "77d71526-0f5a-4f5b-8f00-964454aaf53e",
    "concept": "Pandalus platyceros",
    "observer": "brian",
    "observation_timestamp": "2017-08-22T20:38:48.219Z",
    "video_reference_uuid": "b6be1826-7413-48cc-8b74-324477eed114",
    "imaged_moment_uuid": "52cf5b45-427a-4d01-a175-e89387da419f",
    "elapsed_time_millis": 0,
    "associations": [],
    "image_references": [
      {
        "uuid": "e9e7a01f-f675-4f08-9434-1eaf0f462c3d",
        "description": "uncompressed image",
        "url": "http://somserver.org/images/i2MAP_2020170622T173833Z-b6be1826.png",
        "format": "image/png",
        "last_updated_time": "2017-09-11T14:37:09Z"
      },
      {
        "uuid": "ec4715f3-705f-4ece-b966-05c814ab6666",
        "description": "uncompressed image",
        "url": "http://somserver.org//images/i2MAP_2020170622T173833Z-b6be1826.png",
        "format": "image/png",
        "last_updated_time": "2017-09-12T15:21:52Z"
      }
    ]
  }
]

Returns

It returns the annotations, as json, after they are inserted. Note that you do not need to define any uuids, such as observation_uuid or uuid (other than the video_reference_uuid which indicates what video the annotations are associated with), however, the returned annotations will have the uuid keys generated by the database.

Delete

Deletes all annotations associated with a given video (defined by it's video_reference_uuid}.

Endpoint

/anno/v1/fast/videoreference/{video_reference_uuid}

Example

DELETE /anno/v1/fast/videoreference/b6be1826-7413-48cc-8b74-324477eed114
Authorization: Bearer <jwt access token>

Returns

Counts of all the objects deleted

{
  "video_reference_uuid": "ef78c89e-079e-4e78-9645-56cfb2c23e3e",
  "ancillary_data_count": 0,
  "image_reference_count": 108,
  "association_count": 10,
  "observation_count": 500,
  "imaged_moment_count": 499
}