aws / aws/amazon-sagemaker-examples

Object detection: wrong class id and class name mappings in "categories" list in an image annotation file

Open
#796 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

While running the [example](https://github.com/awslabs/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/object_detection_pascalvoc_coco/object_detection_image_json_format.ipynb) given by Amazon SageMaker for Object Detection, I'm not able to understand how the "categories" property stores the mapping between the class index and class name. For instance, for an image "000000183716.jpg" the annotation file "000000183716.json" generated after running the code in juypter notebook has the following contents:
`{"file": "000000183716.jpg", "image_size": [{"width": 353, "height": 500, "depth": 3}], "annotations": [
{"class_id": 27, "top": 259, "left": 86, "width": 32, "height": 41},
{"class_id": 27, "top": 229, "left": 220, "width": 51, "height": 248},
{"class_id": 0, "top": 47, "left": 2, "width": 219, "height": 447},
{"class_id": 56, "top": 74, "left": 8, "width": 340, "height": 156},
{"class_id": 0, "top": 14, "left": 148, "width": 203, "height": 468}],
"categories": [{"class_id": 32, "name": "tie"},
{"class_id": 32, "name": "tie"},
{"class_id": 1, "name": "person"},
{"class_id": 62, "name": "chair"},
{"class_id": 1, "name": "person"}]}`
In the above JSON annotations list, [27, 0, 56] corresponds to ["tie", "person", "face"] respectively. However, the categories list [32, 1, 62] corresponds to [tie, person, chair] respectively. Though, there is no chair in this image. I want to know how exactly these two properties work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.