{"id":24576139,"url":"https://github.com/alireza-py/yolodatahelper","last_synced_at":"2025-10-29T04:39:25.540Z","repository":{"id":270267061,"uuid":"909752451","full_name":"alireza-py/YoloDataHelper","owner":"alireza-py","description":"A Python tool for managing YOLO datasets, including YOLOv5, YOLOv8, YOLOv11 and other Ultralytics-supported models. It streamlines tasks like dataset combination, data augmentation, class removal, and annotation visualization supports bounding box and segmentation formats, making it an essential tool for developers and researchers.","archived":false,"fork":false,"pushed_at":"2025-08-16T21:59:19.000Z","size":6783,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T00:54:00.228Z","etag":null,"topics":["annotation-visualization","data-augmentation","dataset-combinations","opencv","ultralytics","yolo-dataset","yolov11","yolov5","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alireza-py.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-29T17:13:30.000Z","updated_at":"2025-08-16T21:59:22.000Z","dependencies_parsed_at":"2025-03-08T16:19:29.677Z","dependency_job_id":"79419d8f-4e9f-46a1-879a-a3ef4188757d","html_url":"https://github.com/alireza-py/YoloDataHelper","commit_stats":null,"previous_names":["alireza-py/yolodatahelper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alireza-py/YoloDataHelper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alireza-py%2FYoloDataHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alireza-py%2FYoloDataHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alireza-py%2FYoloDataHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alireza-py%2FYoloDataHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alireza-py","download_url":"https://codeload.github.com/alireza-py/YoloDataHelper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alireza-py%2FYoloDataHelper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281563766,"owners_count":26522699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotation-visualization","data-augmentation","dataset-combinations","opencv","ultralytics","yolo-dataset","yolov11","yolov5","yolov8"],"created_at":"2025-01-23T22:21:49.555Z","updated_at":"2025-10-29T04:39:25.522Z","avatar_url":"https://github.com/alireza-py.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cp align=\"center\"\u003eWelcome to YoloDataHelper 💡\u003c/p\u003e\n\n**YoloDataHelper** is a small Python utility to process YOLO(you only look once) datasets. This is a utility tool for merging datasets, augmenting data, removing classes, visualizing annotations, and other operations that make working with YOLO datasets easier by developers and researchers.\n\n## 🛠️ Features //\n\n### 1. **Dataset Combination**\n- Combine multiple YOLO datasets while properly aligning classes and adjusting label IDs.\n- Retain the original structure of the datasets and generate a unified `data.yaml` file.\n\n### 2. **Data Augmentation**\n- Apply various transformations to YOLO dataset images, such as:\n  - Hue, saturation, and brightness adjustments.\n  - Contrast enhancement.\n  - Adding random noise.\n  - Color jittering.\n- Generate augmented images with updated labels.\n\n### 3. **Class Removal**\n- Remove specific classes from the dataset and their associated images and labels.\n- Automatically adjust class IDs and update the `data.yaml` file accordingly.\n\n### 4. **Annotation Visualization**\n- Display bounding boxes or segmentation masks over images for easy verification.\n- Save annotated images to a specified output directory.\n\n### 5. **Classes Equalization**\n- Balance the number of images per class to ensure a uniform distribution.\n- Adjust the dataset to prevent class imbalance issues.\n\n### 6. **Dataset Validation**\n- Ensure the presence of the necessary directories (`train`, `valid`, `test`) and their subfolders (`images`, `labels`).\n- Automatically create any missing directories if they don’t exist.\n\n### 7. **Resize Options**\n- Compression: Resize with compressing images\n- Advanced_compression: Resize with advanced compressing images\n- Crop: Resize with cropping images\n- Advanced_crop: Resize with advanced cropping images\n\n---\n\n## 📦 Installation //\n\n### Clone the Repository\n\nTo get started, first clone the repository:\n\n```bash\ngit clone https://github.com/alireza-py/YoloDataHelper.git\ncd YoloDataHelper\n```\n### Install Dependencies\nInstall the necessary dependencies using pip:\n```bash\npip install -r requirements.txt\n```\n## 🚀 How to Use //\n**Run Directly**\nTo use the tool as a standalone application, simply run the `main.py` file:\n```bash\npython main.py\n```\n### 1. Dataset Combination\nCombine multiple YOLO datasets into a unified dataset:\n  ```python\n  from YoloDatasetsTools import DatasetProcessor\n  \n  datasets = [\"path/to/dataset1\", \"path/to/dataset2\"]\n  output_path = \"path/to/combined_dataset\"\n  \n  processor = DatasetProcessor(output_path)\n  processor.combine_datasets(datasets)\n  ```\n### 2. Data Augmentation\nApply data augmentation to a dataset:\n```python\nfrom YoloDatasetsTools import DatasetProcessor\n\noutput_path = \"path/to/augmented_dataset\"\naugmentation_params = {\n     'hue': (-10, 10),\n     'saturation': (0.7, 1.3),\n     'brightness': (0.7, 1.3),\n     'contrast': (0.8, 1.2),\n     'noise': (10, 50),\n     'color_jitter': (0.9, 1.1)\n}\nprocessor = DatasetProcessor(output_path, augmentation_params=augmentation_params, multiplier=3)\n\nprocessor.process_folder(input_folder=\"path/to/dataset\")\n```\n### 4. Annotation Visualization\nVisualize bounding boxes or segmentation masks:\n```python\nfrom YoloDatasetsTools import DatasetProcessor\n\noutput_path = \"path/to/visualized_dataset\"\nprocessor = DatasetProcessor(output_path)\n\nprocessor.visualize_annotations(dataset_folder=\"path/to/dataset\")\n```\n### 5. Classes Equalization\n```python\nfrom YoloDatasetsTools import DatasetProcessor\n\ncleaner = DatasetCleaner(dataset_folder=\"path/to/dataset\")\n\ncleaner.classes_equalization(subset=[\"train\", \"valid\", \"test\"])\n```\n### 6. Directory Validation\nEnsure required directories (train, valid, test) and their subfolders exist:\n```python\nfrom YoloDatasetsTools import DatasetProcessor\n\ndataset_path = \"path/to/dataset\"\nprocessor = DatasetProcessor(dataset_path)\n\nprocessor.ensure_dataset(dataset_path)\n```\n### 7. Resize Options\n```python\nfrom YoloDatasetsTools import DatasetProcessor\n\ndataset_path = \"path/to/dataset\"\noutput_path = \"path/to/output_dataset\"\nsize = (720, 340)\nmode = \"advance_crop\"\n\nprocessor = DatasetProcessor(dataset_path)\n\nprocessor.process_resize_and_crop(\n  dataset_path, \n  output_path, \n  size,\n  mode\n  )\n```\n## 📚 Directory Structure //\nThis tool assumes the following directory structure for YOLO datasets:\n```python\ndataset/\n  ├── train/\n  │   ├── images/\n  │   └── labels/\n  ├── valid/\n  │   ├── images/\n  │   └── labels/\n  └── test/\n  │   ├── images/\n  │   └── labels/\n  └── data.yaml\n```\nThe data.yaml file should include:\n- train, val, and test: Paths to the respective datasets.\n- nc: The number of classes.\n- names: A list of class names.\n\n## 💥 Contributing //\nContributions are welcome! If you'd like to contribute to YoloDataHelper, you can:\n- Fork the repository.\n- Create a new branch for your feature or bug fix.\n- Commit your changes and push the branch.\n- Open a pull request with a description of the changes.\n- If you encounter any issues, feel free to open an issue in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falireza-py%2Fyolodatahelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falireza-py%2Fyolodatahelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falireza-py%2Fyolodatahelper/lists"}