Giter Club home page Giter Club logo

Comments (5)

jnothman avatar jnothman commented on June 5, 2024 1

We could solve both this and #6 with one of the following designs. (Note again that these designs serve the purpose of going beyond weed ID as well, and would even apply to camera traps.)

Add a collection_ids key to Annotation objects, which references a list of indexes.

The collections key of the main JSON blob would contain a list of Collection objects. Each Collection object can contain arbitrary DCMI fields.

Now I'm a bit stuck. Which of the following?

  • Subset objects: Have a separate list of 'subsets' each of which contains 'collection_id' and 'name', and each Annotation references both 'collection_ids' and 'subset_ids'?
    "annotations": [
      {...,
       "id": 0,
       "collection_ids": [0],
       "subset_ids": [0]},
      {...,
       "id": 1,
       "collection_ids": [0],
       "subset_ids": [1]}
    ],
    "collections": [
      {"id": 0,
       "title": "myweeds",
       "identifier": "doi:0000000/000000000000",
       "annotation_count": 158,
       "image_count": 104}
    ],
    "subsets": [
      {"id": 0,
       "name": "myweeds train",
       "collection_id": 0,
       "annotation_count": 120,
       "image_count": 81},
      {"id": 1,
       "name": "myweeds test",
       "collection_id": 0,
       "annotation_count": 38,
       "image_count": 23}
    ]
  • Some collections are subsets: Some collections contain a 'part_of_collection_id' key (or a better name), and perhaps no DCMI but name because this is sufficient to inherent the DCMI from the parent collection? In that case, the annotation would need to point to both the subset collection ID and the complete collection ID. :\
    "annotations": [
      {...,
       "id": 0,
       "collection_ids": [0, 1]},
      {...,
       "id": 1,
       "collection_ids": [0, 2]}
    ],
    "collections": [
      {"id": 0,
       "title": "myweeds",
       "identifier": "doi:0000000/000000000000",
       "annotation_count": 158,
       "image_count": 104},
      {"id": 1,
       "title": "myweeds train",
       "part_of_collection_id": 0,
       "annotation_count": 120,
       "image_count": 81},
      {"id": 2,
       "title": "myweeds test",
       "part_of_collection_id": 0,
       "annotation_count": 38,
       "image_count": 23},
    ]
  • Associative entity: Another list of objects, "collection_memberships" references both Annotation and Collection. This associated entity is annotated with a subset name. This avoids storing a list of collection IDs in an annotation, improving consistency with existing COCO format, but it's a little harder to perform some operations over the dataset. This is closest to a relational database representation.
    "annotations": [
      {...,
       "id": 0,
      {...,
       "id": 1}
    ],
    "collections": [
      {"id": 0,
       "title": "myweeds",
       "identifier": "doi:0000000/000000000000",
       "annotation_count": 158,
       "image_count": 104}
    ],
    "collection_memberships": [
      {"annotation_id": 0,
       "collection_id": 0,
       "subset": "train"},
      {"annotation_id": 1,
       "collection_id": 0,
       "subset": "test"}
    ]
  • Collections define their subsets: Each Collection may contain a list of 'subsets', each of which then has a name and references a list of annotations by their UUID (because not all annotations will be present in a single export).
    "annotations": [
      {...,
       "id": 0,
       "uuid": "11111111-bf65-11ea-b3de-0242ac130004",
       "collection_ids": [0]},
      {...,
       "id": 1,
       "uuid": "22211111-bf65-11ea-b3de-0242ac130004",
       "collection_ids": [0]}
    ],
    "collections": [
      {"id": 0,
       "title": "myweeds",
       "identifier": "doi:0000000/000000000000",
       "subsets": [
         {"title": "myweeds train",
          "annotation_uuids": [
            "11111111-bf65-11ea-b3de-0242ac130004",
            "11111112-bf65-11ea-b3de-0242ac130004",
            "11111113-bf65-11ea-b3de-0242ac130004",
            ...]}
         {"title": "myweeds test",
          "annotation_uuids": [
            "22211111-bf65-11ea-b3de-0242ac130004",
            "22211112-bf65-11ea-b3de-0242ac130004",
            "22211113-bf65-11ea-b3de-0242ac130004",
            ...]}
       ]}
    ]

I've put in things that allow you to check that your current JSON blob contains the entirety of a collection...

from weed-ai.

jnothman avatar jnothman commented on June 5, 2024

@hlydecker notes that we should avoid too much bloat/complication. It's a very fair point. But I think the idea of being able to represent that an annotation is included in one or more collections is worthwhile anyway... I think the challenge is working out how to represent "in multiple collections", which I think is a use case we will need down the line.

from weed-ai.

hlydecker avatar hlydecker commented on June 5, 2024

Your last two solutions look like the most appealing options to me. With your last "collections defining their subset" scenario, would each JSON blob then contain a list of all the images in each collection, or just the particular images within that collection which exist elsewhere in the JSON?

from weed-ai.

jnothman avatar jnothman commented on June 5, 2024

With your last "collections defining their subset" scenario, would each JSON blob then contain a list of all the images in each collection

My idea of using UUIDs is that it lists every annotation in the collection, regardless of whether they're in the current blob. it's a bit antithetical to the locally integral structure of COCO.

from weed-ai.

hlydecker avatar hlydecker commented on June 5, 2024

Would comparing the images in the current blob with the collection's origin blob be a possible way to get around dragging a list of all images along with every potential subset/re-use of the data?

from weed-ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.