The to_yolov8 package facilitates the conversion of datasets from the YOLO format (Label Studio) to the YOLOv8 format, which is compatible with Ultralytics models.
Project description
to_yolov8
The 'to_yolov8' package facilitates the conversion of datasets from the YOLO format (exported from Label Studio) to the YOLOv8 format, which is compatible with Ultralytics models. This utility is designed to streamline the process of preparing datasets for training and evaluating machine learning models in the YOLOv8 architecture.
Overview
The tool is primarily aimed at addressing the specific data formatting and splitting requirements of the YOLOv8 model. It ensures that the dataset is appropriately organized and formatted, enabling seamless integration with Ultralytics' YOLOv8 implementations.
Key Features
Data Splitting: Automatically divides the dataset into training, validation, and testing subsets. The default split is 70% for training, 20% for validation, and 10% for testing, but this can be customized. Format Conversion: Converts classes.txt (YOLO format) to data.yaml (YOLOv8 format), ensuring compatibility with YOLOv8’s expected dataset structure. Directory Structure Adjustment: Reorganizes image and label files into separate directories for training, testing, and validation, aligning with YOLOv8's directory requirements. Flexibility and Customization: Supports custom splits and allows for additional files in the source directory, which are simply ignored during the conversion process.
Installation
To install, run:
pip install to_yolov8
Usage
The 'to_yolov8' package can be used either through a command-line interface (CLI) or as part of a Python script.
CLI
Run the following commands in your terminal:
to_yolov8 --source_dir <source_directory_path> [--dest_dir <destination_directory_path>] [--split <train_ratio,test_ratio,valid_ratio>]
--source_dir: Path to the source directory containing the YOLO formatted dataset. --dest_dir (optional): Path to the destination directory where the YOLOv8 formatted dataset will be stored. If not specified, the source directory will be used. --split (optional): Custom split ratios for training, testing, and validation sets. The default is 70% training, 20% testing, and 10% validation
Script
Include and use the converter in your Python scripts as follows:
from to_yolov8 import YoloToYolov8Converter
converter = YoloToYolov8Converter()
converter.convert(source_dir=source_dir, dest_dir=dest_dir, train_ratio=0.7, val_ratio=0.2)
Contributing
Contributions to the 'to_yolov8' package are welcome. If you have suggestions for improvements or encounter any issues, please feel free to open an issue or submit a pull request on our GitHub repository.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file to_yolov8-0.0.1.tar.gz.
File metadata
- Download URL: to_yolov8-0.0.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae3129aa320db60a10c295feb738f57b9f37e275bd8db162ee82383c23ef13ec
|
|
| MD5 |
783e0b4a8d044ae06e95f1a8a7c7118e
|
|
| BLAKE2b-256 |
a76fc889c6dfbb14f910b0f96645670b71d94c67728f1c71efd1423cd32e0304
|
File details
Details for the file to_yolov8-0.0.1-py3-none-any.whl.
File metadata
- Download URL: to_yolov8-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b352889f1f672d5214f6c0acea64f0be9400c2d77bee1eee6bea67e8e3bf6cd5
|
|
| MD5 |
fea599a1ca846442479ce3d3951f725e
|
|
| BLAKE2b-256 |
3f0a5c046c115f40b7a84cc284ca14ea0803f4570f18f9c2e939d77dabcd821c
|