docs/en/datasets/index.md
Ultralytics provides support for various datasets to facilitate computer vision tasks such as detection, instance segmentation, pose estimation, classification, and multi-object tracking. Below is a list of the main Ultralytics datasets, followed by a summary of each computer vision task and the respective datasets.
<p align="center"> <iframe loading="lazy" width="720" height="405" src="https://www.youtube.com/embed/YDXKa1EljmU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen> </iframe><strong>Watch:</strong> Ultralytics Datasets Overview
</p>Bounding box object detection is a computer vision technique that involves detecting and localizing objects in an image by drawing a bounding box around each object.
Instance segmentation is a computer vision technique that involves identifying and localizing objects in an image at the pixel level. Unlike semantic segmentation which only classifies each pixel, instance segmentation distinguishes between different instances of the same class.
Pose estimation is a technique used to determine the pose of the object relative to the camera or the world coordinate system. This involves identifying key points or joints on objects, particularly humans or animals.
Image classification is a computer vision task that involves categorizing an image into one or more predefined classes or categories based on its visual content.
Oriented Bounding Boxes (OBB) is a method in computer vision for detecting angled objects in images using rotated bounding boxes, often applied to aerial and satellite imagery. Unlike traditional bounding boxes, OBB can better fit objects at various orientations.
Multi-object tracking is a computer vision technique that involves detecting and tracking multiple objects over time in a video sequence. This task extends object detection by maintaining consistent identities of objects across frames.
Contributing a new dataset involves several steps to ensure that it aligns well with the existing infrastructure. Below are the necessary steps:
<p align="center"> <iframe loading="lazy" width="720" height="405" src="https://www.youtube.com/embed/yMR7BgwHQ3g?start=427" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen> </iframe><strong>Watch:</strong> How to Contribute to Ultralytics Datasets
</p>Collect Images: Gather the images that belong to the dataset. These could be collected from various sources, such as public databases or your own collection.
Annotate Images: Annotate these images with bounding boxes, segments, or keypoints, depending on the task.
Export Annotations: Convert these annotations into the YOLO *.txt file format which Ultralytics supports.
Organize Dataset: Arrange your dataset into the correct folder structure. You should have images/ and labels/ top-level directories, and within each, a train/ and val/ subdirectory.
dataset/
├── images/
│ ├── train/
│ └── val/
└── labels/
├── train/
└── val/
Create a data.yaml File: In your dataset's root directory, create a data.yaml file that describes the dataset, classes, and other necessary information.
Optimize Images (Optional): If you want to reduce the size of the dataset for more efficient processing, you can optimize the images using the code below. This is not required, but recommended for smaller dataset sizes and faster download speeds.
Zip Dataset: Compress the entire dataset folder into a zip file.
Document and PR: Create a documentation page describing your dataset and how it fits into the existing framework. After that, submit a Pull Request (PR). Refer to Ultralytics Contribution Guidelines for more details on how to submit a PR.
!!! example "Optimize and Zip a Dataset"
=== "Python"
```python
from pathlib import Path
from ultralytics.data.utils import compress_one_image
from ultralytics.utils.downloads import zip_directory
# Define dataset directory
path = Path("path/to/dataset")
# Optimize images in dataset (optional)
for f in path.rglob("*.jpg"):
compress_one_image(f)
# Zip dataset into 'path/to/dataset.zip'
zip_directory(path)
```
By following these steps, you can contribute a new dataset that integrates well with Ultralytics' existing structure.
Ultralytics supports a wide variety of datasets for object detection, including:
These datasets facilitate training robust Ultralytics YOLO models for various object detection applications.
Contributing a new dataset involves several steps:
*.txt format.train/ and val/ directories, each containing images/ and labels/ subdirectories.data.yaml File: Include dataset descriptions, classes, and other relevant information.Visit Contribute New Datasets for a comprehensive guide.
Ultralytics Platform offers powerful features for dataset management and analysis, including:
The platform streamlines the transition from dataset management to model training, making the entire process more efficient. Learn more about Ultralytics Platform Datasets.
Ultralytics YOLO models provide several unique features for computer vision tasks:
Discover more about YOLO models on the Ultralytics Models page.
To optimize and zip a dataset using Ultralytics tools, follow this example code:
!!! example "Optimize and Zip a Dataset"
=== "Python"
```python
from pathlib import Path
from ultralytics.data.utils import compress_one_image
from ultralytics.utils.downloads import zip_directory
# Define dataset directory
path = Path("path/to/dataset")
# Optimize images in dataset (optional)
for f in path.rglob("*.jpg"):
compress_one_image(f)
# Zip dataset into 'path/to/dataset.zip'
zip_directory(path)
```
This process helps reduce dataset size for more efficient storage and faster download speeds. Learn more on how to Optimize and Zip a Dataset.