Megvii-BaseDetection / Megvii-BaseDetection/YOLOX
Understand label conversion
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
Hi @FateScript and others, thanks for this great contribution! I'm writing a dataloader for a custom dataset and I've having a bit of trouble with the format of labels at different steps and how the conversions happen. It could be that some comments in the code are correct, would be great if we could confirm a few things.
For coco dataset, it looks like the pull_item should be returning labels in the xyxy format resulting from:
https://github.com/Megvii-BaseDetection/YOLOX/blob/d78fe47802d3987a915645179d87f5c1a96e646f/yolox/data/datasets/coco.py#L149
Now in MosaicDetection:
- for the case when mosaic is disabled, we can see that the
prepoc(I'm usingTrainTransformfor that) leads to conversion from xyxy to cxcywh here:
https://github.com/Megvii-BaseDetection/YOLOX/blob/d78fe47802d3987a915645179d87f5c1a96e646f/yolox/data/datasets/mosaicdetection.py#L159 - for the case when mosaic is enabled, this line does a
pull_item: https://github.com/Megvii-BaseDetection/YOLOX/blob/d78fe47802d3987a915645179d87f5c1a96e646f/yolox/data/datasets/mosaicdetection.py#L93
and this_labelsshould be in xyxy format. But that contradicts the comment here: https://github.com/Megvii-BaseDetection/YOLOX/blob/d78fe47802d3987a915645179d87f5c1a96e646f/yolox/data/datasets/mosaicdetection.py#L113 which says that we are going from normalized xywh to xyxy. Could you confirm that this is indeed incorrect?
Is it safe to assume that pull_item for my custom dataset should be returning xyxy format for everything else to work correctly?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read yolox/data/datasets/coco.py around pull_item and yolox/data/datasets/mosaicdetection.py around the mosaic and preprocessing paths. Trace the label format at each referenced step, then confirm the expected custom-dataset contract and correct the misleading comment or documentation. Done means the conversion sequence and pull_item format are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100