kwcoco icon indicating copy to clipboard operation
kwcoco copied to clipboard

Add new attribute - "tag_category"

Open lpogo opened this issue 2 years ago • 2 comments

Hi, can I ask you to add one more attribute to coco definition called tag_category?

I have tagged my images to be able to filter dataset more precise. I would be able to add tag_categories like below:

 "tag_categories": [
  {
   "id": 0,
   "name": "tag1"
  },
  {
   "id": 1,
   "name": "tag2"
  }
 ]

and then add tag to image:

  {
   "file_name": "0B7414E1.png",
   "height": 3024,
   "width": 4032,
   "id": 1,
   "tag_ids": [
    0
   ]
 }

Thanks in advanve!

lpogo avatar Nov 28 '22 10:11 lpogo

I would suggest simply adding a field to images called "tags" which is a list of strings.

  {
   "file_name": "0B7414E1.png",
   "height": 3024,
   "width": 4032,
   "id": 1,
   "tags": ["tag1", "tag2"]
 }

This does have a drawback in that the json file will not scale as well as your proposed method, but the json dictionary storage doesn't scale to extremely large datasets to begin with.

Setting up the logic for an additional table using the dictionary based interface is not trivial. This may be a consideration for future work, but it is not something I can quickly pull together.

Erotemic avatar Nov 28 '22 16:11 Erotemic

@Erotemic this looks like good enough workaround for this moment. Thanks for suggestion. Anyway, looking forward for future implementation :)

lpogo avatar Nov 29 '22 09:11 lpogo