Managing category id=0 in COCO JSON export

How can I define/manage the id=0 category given in a COCO Json export from roboflow? According to this post it is currently defined to be:

the “Annotation group” name you input at the time of project creation as a supercategory for other categories

I’m currently exporting and trying to do something with Google’s MediaPipe api, which throws the following error:

ValueError: Label index 0 is reserved for the background class, but it was found to be trash-7fnV

This is due to the fact that roboflow exports the following categories in the json file.

"categories":[{"id":0,"name":"trash-7fnV","supercategory":"none"},{"id":1,"name":"other_avoid","supercategory":"trash-7fnV"},{"id":2,"name":"other_avoid_boundaries","supercategory":"trash-7fnV"},{"id":3,"name":"other_avoid_ocean","supercategory":"trash-7fnV"},{"id":4,"name":"others_traversable","supercategory":"trash-7fnV"},{"id":5,"name":"trash_easy","supercategory":"trash-7fnV"},{"id":6,"name":"trash_hard","supercategory":"trash-7fnV"}]

Without manually editing every json file exported by roboflow, how can I control the value of this id=0 to be “background” rather than some class “trash-7fnV” that I did not define or use in the dataset. In fact, this error would also not be an issue if this category “trash-7fnV” was removed completely (i.e. no id=0 category). I see no way to remove or modify this currently.

  • **Project Type:Object detection
  • **Operating System & Browser:Ubuntu 22.04 Firefox 130.0
  • **Project Universe Link or Workspace/Project ID:beach-cleaning-object-detection

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.