https://github.com/gabrli/yololint
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.
https://github.com/gabrli/yololint
annotation-tool cli-tool computer-vision data-quality dataset-validation deep-learning linter machine-learning object-detection python training-pipeline yolo yolov5 yolov8
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/gabrli/yololint
- Owner: Gabrli
- License: apache-2.0
- Created: 2025-05-11T15:54:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-22T19:23:30.000Z (12 months ago)
- Last Synced: 2025-11-29T04:29:35.169Z (7 months ago)
- Topics: annotation-tool, cli-tool, computer-vision, data-quality, dataset-validation, deep-learning, linter, machine-learning, object-detection, python, training-pipeline, yolo, yolov5, yolov8
- Language: Python
- Homepage: https://yololint.vercel.app/
- Size: 206 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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
```sh
yololint-structure-v
```
### Annotation validation
```sh
yololint-annotation-v
```
### Image size validation and rescaling
```sh
yololint-sizes-v
```
---
## 📚 Documentation – How to Use
### Validate Dataset Structure
```python
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
```python
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
```python
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`
```yaml
names: ['class1', 'class2', 'class3']
nc: 3
```
---
## 👨💻 Author
- Gabriel Wiśniewski
---
## 📄 License
Project is licensed under the Apache License.