I have images and their corresponding bounding box coordinates in a JSON file, but when I upload them together, Roboflow isn't linking them correctly to generate annotated images

Issue:

I’m working on a surgical object detection project and I have a dataset comprising image files and a corresponding JSON file that contains the bounding box coordinates for each image. However, when I upload both the images and the JSON file to Roboflow, the platform does not automatically link the annotations to the images. As a result, none of the images are being displayed as annotated, and the bounding boxes are not rendered.

I have verified that the image filenames match the keys or references used inside the JSON file. Still, the annotations aren’t recognized, suggesting either a formatting mismatch or an issue with the import process. I believe the problem might be related to how Roboflow is interpreting the structure of the JSON, and I would appreciate guidance on how to correctly upload or restructure the annotation file so it links to the images properly.

Could you please advise if:

  1. There is a specific JSON format (like COCO, VOC, or a custom schema) that Roboflow expects for annotations?
  2. There’s a way to map my current JSON structure to the format Roboflow supports?
  3. You have any tools or scripts to convert non-standard JSON files into a compatible annotation format?

Details:

  • Project Type: Object detection surgical
  • Operating System & Browser: Windows and Firefox
  • Project Universe Link or Workspace/Project ID: cholect50

Hi @Tixtor710!
I’m sorry you have run into this issue. To answer your questions:

  1. Yes, Roboflow supports multiple standard annotation formats. For JSON specifically, COCO is the most commonly utilized format. Here is a link to that expands on Roboflow’s supported formats.

  2. You can convert your structure into COCO using a custom script. To create the custom script, you can use a prompt like this in ChatGPT. I suggest providing ChatGPT a sample of your current format to help tailor this script.

Write a python script to convert my custom annotation JSON (structured with 
filenames as keys and bounding boxes as values) into a COCO format JSON file
for object detection. Include Image IDs, annotation IDs, and a sample categories
section
  1. At this time, Roboflow doesn’t offer a built in tool to convert non-standard JSON files into a proper format, however the above prompt will be able to quickly accomplish this for you.
1 Like