YOLO Dataset Debugger (yololint) is a tool for automatic validation and diagnostics of YOLO-format datasets. It helps you quickly detect common errors, inconsistencies, and missing files in your dataset structure and annotations before you start model training. With clear reports and easy usage, you save time and ensure your dataset is ready for deep learning projects.
Project description
YOLO Dataset Debugger - (YoloLint)
๐ About
YoloLint is a tool for automatic validation of dataset structure, annotation files, and image sizes in YOLO projects. It helps you catch typical errors in directory structure, YAML files, annotation files, and now also ensures all your images have the correct size before you start model training.
๐ฆ Directory Structure
.
โโโ yololint/
โ โโโ clis/
โ โ โโโ structure_validator_cli.py
โ โ โโโ annotation_checker_cli.py
โ โ โโโ sizes_checker_cli.py
โ โโโ structure_validator.py
โ โโโ annotation_checker.py
โ โโโ sizes_checker.py
โ โโโ utils/
โ โ โโโ compare_validate.py
โ โ โโโ add_file_to_list.py
โ โโโ constants/
โ โโโ folders.py
โโโ tests/
โ โโโ test_structure_validator.py
โ โโโ test_annotation_checker.py
โ โโโ utils/
โ โโโ prepare_lib_proccess.py
โโโ requirements.txt
โโโ setup.py
โโโ README.md
๐ฅ๏ธ Available Console Scripts
After installing the package, you can use the following commands in your terminal:
Structure validation
yololint-structure-v <path_to_your_dataset>
Annotation validation
yololint-annotation-v <path_to_labels_folder> <number_of_classes>
Image size validation and rescaling
yololint-sizes-v <path_to_your_dataset> <width> <height>
๐ Documentation โ How to Use
Validate Dataset Structure
from yololint.structure_validator import StructureValidator
dataset_path = "/path/to/your/dataset"
checker = StructureValidator(dataset_path)
result = checker.dataset_validation()
print(result)
- Function:
StructureValidator.dataset_validation() - Description: Checks if the folder structure and
data.yamlare correct, and if the number of classes and class names match.
Validate YOLO Annotation Files
from yololint.annotation_checker import AnnotationChecker
labels_path = "/path/to/your/dataset/labels"
classes_count = 3 # number of classes in your dataset
checker = AnnotationChecker(labels_path, classes_count)
result = checker.annotation_checker()
print(result)
- Function:
AnnotationChecker.annotation_checker() - Description: Checks if all
.txtfiles have the correct format (5 values per line, valid class_id) and are not empty.
Validate and Rescale Image Sizes
from yololint.sizes_checker import SizesChecker
sizeX = 640 # expected width
sizeY = 480 # expected height
dataset_path = "/path/to/your/dataset"
checker = SizesChecker(sizeX, sizeY)
checker.check_sizes(dataset_path)
- Function:
SizesChecker.check_sizes(path_to_dataset) - Description: Checks if all images in the dataset have the specified size. If an image has a different size, you will be prompted in the terminal to rescale it automatically.
๐ Example data.yaml
names: ['class1', 'class2', 'class3']
nc: 3
๐จโ๐ป Author
- Gabriel Wiลniewski
๐ License
Project is licensed under the Apache 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
File details
Details for the file yololint-1.1.2.tar.gz.
File metadata
- Download URL: yololint-1.1.2.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd753f250ab962c4e2da3a30d1eca160104284673a38b3f150412dfdc00841f6
|
|
| MD5 |
d18055538c2b59f9c8c5afae1c771f3d
|
|
| BLAKE2b-256 |
9d884600b894c99d6268ab4e202d85b0470023765040f8e3745fa5408a566f12
|