Conversation
|
Hi @AyushExel, Thank you for your contribution! 🎉 Your effort to convert the JSON2YOLO tools into a maintainable and easily installable Python package is much appreciated. This will certainly streamline the usage and distribution of these tools. Regarding your suggestion to create the If you haven't already, please ensure that this change is compatible with the latest version of the YOLOv5 repository. This will help us avoid any potential integration issues. Here's a quick example of how you might modify the function to create the import os
def convert_coco_json(json_path, output_dir=None):
if output_dir is None:
output_dir = os.path.join(os.path.dirname(json_path), 'labels')
os.makedirs(output_dir, exist_ok=True)
# Conversion logic here
# ...
# Save YAML file
yaml_path = os.path.join(output_dir, 'dataset.yaml')
with open(yaml_path, 'w') as f:
f.write('...') # YAML content hereFeel free to adjust the implementation as needed. Once again, thank you for your valuable contribution to the YOLO community and the Ultralytics team. If you have any further questions or need assistance, please don't hesitate to ask! |
@glenn-jocher
Added setup.py to convert this into into a package. Can be imported in yolov5 to convert datasets on the fly while training.
Usage
Potential improvement:
The function creates a
new_dirby default. Instead we can just create the labels/ folder in the coco dataset dir along with the yaml file needed for subsequent loading of data.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
📊 Key Changes
json2yolodirectory.requirements.txtand added asetup.pyscript to manage package installation.json2yolo/utils.py.🎯 Purpose & Impact
setup.py🛠, installation becomes more conventional and manageable using Python's packaging tools.🌟 Summary
Converted JSON2YOLO tools into a maintainable and easily installable Python package 🎁.