ultralytics / JSON2YOLO

Convert JSON annotations into YOLO format.
https://docs.ultralytics.com
GNU Affero General Public License v3.0
862 stars 232 forks source link

Segmentation Data Normalization for TrashCan Dataset #56

Open rangganast opened 1 year ago

rangganast commented 1 year ago

Greetings, I have been trying to use YOLOv8 recently using TrashCan dataset However, I still don't know how to normalize segmentation label data.

I look everywhere but I don't get any references about it. Any ideas?

Thank you.

ryouchinsa commented 1 year ago

Thanks for writing the issue. We check it works using this script global_json2yolo.py.

Looking at the global_json2yolo code, there are some flags. Converting the COCO bbox format to YOLO bbox format.

use_segments=False,
use_keypoints=False,

Converting the COCO segmentation format to YOLO segmentation format.

use_segments=True,
use_keypoints=False,

Converting the COCO keypoints format to YOLO keypoints format.

use_segments=False,
use_keypoints=True,

To convert the COCO segmentation format to YOLO segmentation format.

if __name__ == '__main__':
    source = 'COCO'

    if source == 'COCO':
        convert_coco_json('../datasets/coco/annotations',  # directory with *.json
                          use_segments=True,
                          use_keypoints=False,
                          cls91to80=False)

This is the folder structure when we run the script.

スクリーンショット 2023-10-25 20 51 05

Please let us know your opinion.

glenn-jocher commented 1 year ago

It looks like you've been exploring the data normalization process for segmentation label data using YOLOv8 with a TrashCan dataset. The script you've referenced, global_json2yolo.py, appears to provide functionality for converting COCO segmentation format to YOLO segmentation format, as well as for converting other COCO data formats to YOLO equivalent. Additionally, the script contains flags for modifying the format conversion process based on specific requirements.

While the global_json2yolo.py script seems to provide some relevant functionality, please ensure that it aligns with the specifications required for your TrashCan dataset. You can modify the script and its flags based on the dataset's specific structure and requirements to ensure accurate label data normalization.

Feel free to further inquire about any specific details or concerns you may have about the data normalization process for the TrashCan dataset.