-
Notifications
You must be signed in to change notification settings - Fork 23
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
Convert yolov5 dataset labels into COCO labels #27
Comments
You can read the YOLOv5 predictions with from globox import AnnotationSet
predictions = AnnotationSet.from_yolo_v5("path/to/annotations", image_folder="path/to/images")
predictions.save_coco(
"coco_preds.json",
label_to_id={"person": 0},
imageid_to_id={im: i for i, im in enumerate(sorted(predictions.image_ids))}
) Conversion to COCO is a little bit tricky as you can see because COCO uses integer ids rather and image names and str class names. In any case you should adapt Note that you can also read COCO annotations with |
Hi, i have same goal, but when i run this code: from globox import AnnotationSet predictions = AnnotationSet.from_yolo_v5("little/labels/", image_folder="little/img/") |
@tesla150600 When you specify Maybe your predictions are already in the right format or some predictions have the wrong label. |
Hi. I want to compare the performance between yolov5 and DETR (from Hugging Face). The custom dataset I have has already txt lables in YOLO format. However, DETR expects labels to be in COCO format.
Can anybody help me how to use this tool?
dataset.yaml
The text was updated successfully, but these errors were encountered: