How veraposeidon/labelme2datasets works
Main Components
• Input Data: Represent the “data” directory where users place LabelMe JSON files, the label_names.txt for class names, and optionally the label_dict.txt for label conversions.
• Conversion Modules:
• labelme_json2dataset: Converts a single JSON file into a dataset output.
• labelme_bbox_json2voc: Processes a folder of JSON files into a VOC-formatted dataset. It further considers optional label conversion using label_dict.
• split_voc_datasets: Splits the generated VOC dataset into training and testing sets.
• voc2coco: Converts a VOC dataset into a COCO-formatted dataset.
Relationships and Interactions
• How input data (LabelMe JSONs and label text files) feed into the conversion modules.
• If applicable, show optional flows – for instance, if a label conversion file is provided (label_dict.txt), then it affects the output in the VOC conversion script.
• Cascading flow: conversion from raw JSON to VOC format, optional splitting of the VOC dataset into train/test sets, and subsequent conversion from VOC to COCO format.
Architectural Patterns or Design Principles
• A modular design where each script is responsible for a well-defined task.
• That the design is organized in a “data pipeline” fashion, where the output of one script can serve as the input to another.
• Separation of concerns – file processing and data conversion are isolated within separate Python modules.