Skip to main content

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)

Python License Status YOLO Linting Tests


๐Ÿš€ 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.yaml are 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 .txt files 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yololint-1.1.2.tar.gz (12.7 kB view details)

Uploaded Source

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

Hashes for yololint-1.1.2.tar.gz
Algorithm Hash digest
SHA256 fd753f250ab962c4e2da3a30d1eca160104284673a38b3f150412dfdc00841f6
MD5 d18055538c2b59f9c8c5afae1c771f3d
BLAKE2b-256 9d884600b894c99d6268ab4e202d85b0470023765040f8e3745fa5408a566f12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page