-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect id and image_id after merging #64
Comments
@Dipankar1997161 I tested a tiny case by merging the below two files( a.json{
"images": [
{
"id": 7,
"file_name": "0007.jpg"
},
{
"id": 8,
"file_name": "0008.jpg"
},
{
"id": 9,
"file_name": "0009.jpg"
}
],
"annotations": [
{
"id": 0,
"image_id": 7,
"category_id": 1
},
{
"id": 1,
"image_id": 8,
"category_id": 0
},
{
"id": 2,
"image_id": 9,
"category_id": 0
}
],
"categories": [
{
"id": 0,
"name": "aaa",
"supercategory": "A"
},
{
"id": 1,
"name": "bbb",
"supercategory": "B"
}
]
} b.json{
"images": [
{
"id": 0,
"file_name": "0000.jpg"
},
{
"id": 1,
"file_name": "0001.jpg"
},
{
"id": 2,
"file_name": "0002.jpg"
}
],
"annotations": [
{
"id": 0,
"image_id": 0,
"category_id": 1
},
{
"id": 1,
"image_id": 1,
"category_id": 0
},
{
"id": 2,
"image_id": 2,
"category_id": 0
}
],
"categories": [
{
"id": 0,
"name": "aaa",
"supercategory": "A"
},
{
"id": 1,
"name": "bbb",
"supercategory": "B"
}
]
}
merged.json{
"images": [
{
"id": 7,
"file_name": "0007.jpg"
},
{
"id": 8,
"file_name": "0008.jpg"
},
{
"id": 9,
"file_name": "0009.jpg"
},
{
"id": 10,
"file_name": "0000.jpg"
},
{
"id": 11,
"file_name": "0001.jpg"
},
{
"id": 12,
"file_name": "0002.jpg"
}
],
"annotations": [
{
"id": 0,
"image_id": 7,
"category_id": 1
},
{
"id": 1,
"image_id": 8,
"category_id": 0
},
{
"id": 2,
"image_id": 9,
"category_id": 0
},
{
"id": 3,
"image_id": 10,
"category_id": 1
},
{
"id": 4,
"image_id": 11,
"category_id": 0
},
{
"id": 5,
"image_id": 12,
"category_id": 0
}
],
"info": null,
"licenses": null,
"categories": [
{
"id": 0,
"name": "aaa",
"supercategory": "A"
},
{
"id": 1,
"name": "bbb",
"supercategory": "B"
}
]
} Env
|
Hey,
I was merging 2 json files, one file image_id starts from 600 to 999. second one has image_id from 000 to 399.
After merging the 2 files, the image id for the first file (600 to 999) is generated correctly.
However, for the second file, the image_ids are wrong. for example, for image_id 399, the generated id is 601 and it follows till 900
Becoz of this, the number of samples for me is reduced to 401 which in reality after merging should be at least over 600.
Could you tell me why is this the case?? how can I resolve this?
Note: I did direct installation using pip install coco-assistant for python 3.6
I have added two snippets
Thank you
The text was updated successfully, but these errors were encountered: