aws / aws/amazon-sagemaker-examples
[Content Improvement] JumpStart Object Detection COCO annotations missmatch
- Dominant language
- Jupyter Notebook
- Stars
- 11k
- Forks
- 7k
- Avg merge
- 8h 29m
- Merged PRs (30d)
- 8
Description
**Link to the notebook**
[JumpStart OD Link.](https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart_object_detection/Amazon_JumpStart_Object_Detection.ipynb)
**What aspects of the notebook can be improved?**
Hi there! just a suggestion as i was (think I still am) pretty confused about this topic.
When fine tuning, the notebook states (section 3 of the above link):
> The annotations.json file should have information for bounding_boxes and their class labels. It should have a dictionary with keys "images" and "annotations". Value for the "images" key should be a list of entries, one for each image of the form {"file_name": image_name, "height": height, "width": width, "id": image_id}. Value of the 'annotations' key should be a list of entries, one for each bounding box of the form {"image_id": image_id, "bbox": [xmin, ymin, xmax, ymax], "category_id": bbox_label}.
If someone is familiar on this topic, one could rapidly guess that what you are asking here is to use the COCO annotation format (as I did) but if we look closer, specifically at the bbox key, what is asked to be filled is:
`"bbox": [xmin, ymin, xmax, ymax]`
but the [COCO annotation format for object detection](https://cocodataset.org/#format-data) specifies:
`"bbox": [x,y,width,height]`
So how do they map each other? at least for me is not clear that:
xmin => x ( min? )
xmax => width (first one will be the width of the image, while the second one is the absolute coordinate)
but then again, if you deep dive into this, and [download any](https://s3.console.aws.amazon.com/s3/buckets/jumpstart-cache-prod-us-east-1?prefix=training-datasets/PennFudanPed_COCO_format/®ion=us-east-1) of the pedestrian examples images proposed in the notebook, and you take the corresponding annotation, and plot their corresponding bbox (like, manually on paint for instance), you'll see that what is being used on the pedestrian dataset is:
`"bbox": [xmin, ymin, xmax, ymax]`
As only the absolute coordinates creates the correct bbox.
Now ...the NAME of the dataset is **PennFudanPed_COCO_format**, but is not following the COCO format!
So what format is being really used? until now i dont fully known wich annotation format should you use on sagemaker (still trying to deploy and test a model)
**What are your suggestions?**
Be clear on what format is being used, if not COCO format, remove the word "COCO" from the folder, and if it is using COCO, then be explicit about it.
Thanks in advance!
Contributor guide
Research direction
Start with section 3 of introduction_to_amazon_algorithms/jumpstart_object_detection/Amazon_JumpStart_Object_Detection.ipynb and compare its bbox description with the linked COCO specification and the PennFudanPed_COCO_format examples. Verify which coordinate convention the notebook and dataset actually use, then clarify the required annotation format and dataset naming in the notebook or related content. Done means a newcomer can identify the expected bbox values without ambiguity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, jupyter-notebook
- Domain
- documentation, machine-learning
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100