Skip to content
/ cocojson Public template

A template repository for new extensions. It enables CI for schema publishing and proposes some core structures.

License

Notifications You must be signed in to change notification settings

AtomicMaps/cocojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COCOJSON Extension Specification

This document explains the COCOJSON Extension to the SpatioTemporal Asset Catalog (STAC) specification.

The COCOJSON format (Common Objects in Context JSON) is a standardized format used to represent object annotations along with metadata including segmentations masks, pixel bounding boxes, and annotation categories commonly used in computer vision. This extension integrates the standarized COCOJSON fields into the STAC Item spec, enabling a practitioner to embed COCOJSON annotations within STAC Items.

Fields

The fields in the table below can be used in these parts of STAC documents:

  • Catalogs
  • Collections
  • Item Properties (incl. Summaries in Collections)
  • Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
  • Links
Field Name Type Description
coco:licenses [License Object] REQUIRED. Describe the required field...
coco:categories [Category Object] Describe the field...
coco:annotations [Annotation Object] Describe the field...

Additional Field Information

template:new_field

This is a much more detailed description of the field template:new_field...

License Object

This is the introduction for the purpose and the content of the XYZ Object...

Field Name Type Description
id number REQUIRED. Integer ID of the license
name string REQUIRED. License name
url string REQUIRED. URL to the license text

Category Object

This is the introduction for the purpose and the content of the XYZ Object...

Field Name Type Description
id number REQUIRED. Integer ID of the category
name string REQUIRED. Name of the category (e.g. 'cat')
supercategory string REQUIRED. General category (e.g. 'animal')

Annotation Object

This is the introduction for the purpose and the content of the XYZ Object...

Field Name Type Description
id number REQUIRED. Integer ID of the annotation
image_id number REQUIRED. Integer ID of the associated images from the 'coco:images' field
category_id number REQUIRED. Integer ID of the associated category from the 'coco:categories' field
bbox /[number/] REQUIRED. Bounding box of the annotation in pixel coordinates
segmentation /[/[number, number/]/] Segmentation mask of the annotation as a list of image coordinates
area number The area of the segmentation mask in pixels
iscrowd bool Tag indicating if the segmentation mask is of a single object or many objects in an image
score number Score 0 - 1.0 indicating the annotation confidence level

Contributing

All contributions are subject to the STAC Specification Code of Conduct. For contributions, please follow the STAC specification contributing guide Instructions for running tests are copied here for convenience.

Running tests

The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid. To run tests locally, you'll need npm, which is a standard part of any node.js installation.

First you'll need to install everything with npm once. Just navigate to the root of this repository and on your command line run:

npm install

Then to check markdown formatting and test the examples against the JSON schema, you can run:

npm test

This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.

If the tests reveal formatting problems with the examples, you can fix them with:

npm run format-examples

About

A template repository for new extensions. It enables CI for schema publishing and proposes some core structures.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published