Add category_id_start parameter to support starting category IDs from 1 #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new parameter
category_id_start
to allow users to specify the starting value for category IDs when converting labelme annotations to COCO format. By default, the category IDs start from 0, but users can now setcategory_id_start
to 1 or any other desired starting value.Changes:
category_id_start
parameter toget_coco_from_labelme_folder
function inlabelme2coco.py
convert
function in__init__.py
to acceptcategory_id_start
parameter and pass it toget_coco_from_labelme_folder
app
function incli.py
to includecategory_id_start
parametercategory_id_start
parameter in both basic and advanced usage sectionsAdditionally, this PR fixes an issue where the file paths were incorrectly formatted in the "file_name" attribute when data is structured in subdirectories. Previously, if an image was located in a subfolder, e.g.,
subfolder_1/image.jpeg
, the "file_name" attribute would only containimage.jpeg
instead of the complete path. This has been fixed to include the full path in the "file_name" attribute.This resolves #17