# Managing category id=0 in COCO JSON export

**URL:** <https://discuss.roboflow.com/t/managing-category-id-0-in-coco-json-export/6994>\
**Category:** 🤝  Community Help\
**Created:** [September 7, 2024, 4:36pm UTC](https://discuss.roboflow.com/t/managing-category-id-0-in-coco-json-export/6994 "2024-09-07T16:36:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asldkj](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/asldkj/32/5425_2.png) [@asldkj](https://discuss.roboflow.com/u/asldkj)\
**Post date:** [September 7, 2024, 4:36pm UTC](https://discuss.roboflow.com/t/managing-category-id-0-in-coco-json-export/6994/1 "2024-09-07T16:36:11Z")

</div>

How can I define/manage the id=0 category given in a COCO Json export from roboflow? According to [this post](https://discuss.roboflow.com/t/how-do-i-import-an-encord-dataset/4289) 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.

```auto
"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.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/5/524d4ebabccb4d769dc8c8f4e85086c893835026.png)

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [September 28, 2024, 4:36pm UTC](https://discuss.roboflow.com/t/managing-category-id-0-in-coco-json-export/6994/2 "2024-09-28T16:36:20Z")

</div>

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