Skip to content

Add a COCO to YOLO converter. #80

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

Open
Abdul-Mukit opened this issue Aug 19, 2024 · 3 comments
Open

Add a COCO to YOLO converter. #80

Abdul-Mukit opened this issue Aug 19, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Abdul-Mukit
Copy link
Contributor

Feature Description

A coco2yolo.py script that converts a COCO formatted detection or instance segmentation dataset into a yolo dataset.
Expected usage:
python coco2yolo.py --cocoroot <root path of coco dataset> --exportpath <root path of expected yolo dataset>
cocoroot will be the root path of coco dataset. This directory will contain "annotations" and "images" folders. The exportpath will be path where the converted data will placed. After conversion finishes the exportpath directory will contain two folders. labels and images. If the exportpath is same as cocoroot the folder images are not over-written.

I am working on a converter and will be making a PR soon. @henrytsui000 will appreciate your help in getting it evaluated and merged. Thanks.

Future Considerations

Currently, it seems that we are making a double effort in data_loader.py to support both types of datasets; COCO and YOLO. This is causing our effort to be diverted to fixing bugs like #67 #36.
Let us make this this converter script and reevaluate, if we should only support yolo formatted dataset. This should help us focus our efforts better.

@Abdul-Mukit Abdul-Mukit added the enhancement New feature or request label Aug 19, 2024
@henrytsui000
Copy link
Member

Hi,

Due to multiple deadlines, I've been quite busy these past few weeks. I will review it during my break time as soon as possible. I deeply appreciate your contribution and your willingness to help with this project!

Best regards,
Henry Tsui

@yjmm10
Copy link

yjmm10 commented Aug 19, 2024

In the past week, I have completed some work, to share:
The data set supports YOLO and COCO formats, and the configuration can specify multiple folders like YOLO, and supports mixing YOLO and COCO formats, so in #72 I might close MR And mention a new one.
I should add that for the image_id problem #67 mentioned earlier, I used a mapping relationship and returned it, which is not supported for YOLO. By default, the cache file is correct when it is generated for the first time and is not verified.
I will PR soon.

@Erotemic
Copy link

Note I have PR where there is some support for this:

#150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants