Skip to content

Register now for

# VisDrone Dataset

The VisDrone Dataset is a large-scale benchmark created by the AISKYEYE team at the Lab of Machine Learning and Data Mining, Tianjin University, China. It contains carefully annotated ground truth data for various computer vision tasks related to drone-based image and video analysis.

Watch: How to Train Ultralytics YOLO Models on the VisDrone Dataset for Drone Image Analysis

VisDrone is composed of 288 video clips with 261,908 frames and 10,209 static images, captured by various drone-mounted cameras. The dataset covers a wide range of aspects, including location (14 different cities across China), environment (urban and rural), objects (pedestrians, vehicles, bicycles, etc.), and density (sparse and crowded scenes). The dataset was collected using various drone platforms under different scenarios and weather and lighting conditions. These frames are manually annotated with over 2.6 million bounding boxes of targets such as pedestrians, cars, bicycles, and tricycles. Attributes like scene visibility, object class, and occlusion are also provided for better data utilization.

## Dataset Structure

The VisDrone dataset is organized into five main subsets, each focusing on a specific task:

1. Task 1: Object detection in images
2. Task 2: Object detection in videos
3. Task 3: Single-object tracking
4. Task 4: Multi-object tracking
5. Task 5: Crowd counting

## Applications

The VisDrone dataset is widely used for training and evaluating deep learning models in drone-based computer vision tasks such as object detection, object tracking, and crowd counting. The dataset's diverse set of sensor data, object annotations, and attributes make it a valuable resource for researchers and practitioners in the field of drone-based computer vision.

## Dataset YAML

A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the Visdrone dataset, the `VisDrone.yaml` file is maintained at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/VisDrone.yaml.

ultralytics/cfg/datasets/VisDrone.yaml

    # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license

    # VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University
    # Documentation: https://docs.ultralytics.com/datasets/detect/visdrone/
    # Example usage: yolo train data=VisDrone.yaml
    # parent
    # ├── ultralytics
    # └── datasets
    #     └── VisDrone ← downloads here (2.3 GB)

    # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
    path: VisDrone # dataset root dir
    train: images/train # train images (relative to 'path') 6471 images
    val: images/val # val images (relative to 'path') 548 images
    test: images/test # test-dev images (optional) 1610 images

    # Classes
    names:
      0: pedestrian
      1: people
      2: bicycle
      3: car
      4: van
      5: truck
      6: tricycle
      7: awning-tricycle
      8: bus
      9: motor

    # Download script/URL (optional) ---------------------------------------------------------------------------------------
    download: |
      import os
      from pathlib import Path
      import shutil

      from ultralytics.utils.downloads import download
      from ultralytics.utils import TQDM

      def visdrone2yolo(dir, split, source_name=None):
          """Convert VisDrone annotations to YOLO format with images/{split} and labels/{split} structure."""
          from PIL import Image

          source_dir = dir / (source_name or f"VisDrone2019-DET-{split}")
          images_dir = dir / "images" / split
          labels_dir = dir / "labels" / split
          labels_dir.mkdir(parents=True, exist_ok=True)

          # Move images to new structure
          if (source_images_dir := source_dir / "images").exists():
              images_dir.mkdir(parents=True, exist_ok=True)
              for img in source_images_dir.glob("*.jpg"):
                  img.rename(images_dir / img.name)

          for f in TQDM((source_dir / "annotations").glob("*.txt"), desc=f"Converting {split}"):
              img_size = Image.open(images_dir / f.with_suffix(".jpg").name).size
              dw, dh = 1.0 / img_size[0], 1.0 / img_size[1]
              lines = []

              with open(f, encoding="utf-8") as file:
                  for row in [x.split(",") for x in file.read().strip().splitlines()]:
                      if row[4] != "0":  # Skip ignored regions
                          x, y, w, h = map(int, row[:4])
                          cls = int(row[5]) - 1
                          # Convert to YOLO format
                          x_center, y_center = (x + w / 2) * dw, (y + h / 2) * dh
                          w_norm, h_norm = w * dw, h * dh
                          lines.append(f"{cls} {x_center:.6f} {y_center:.6f} {w_norm:.6f} {h_norm:.6f}\n")

              (labels_dir / f.name).write_text("".join(lines), encoding="utf-8")

      # Download (ignores test-challenge split)
      dir = Path(yaml["path"])  # dataset root dir
      urls = [
          "https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-train.zip",
          "https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-val.zip",
          "https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-test-dev.zip",
          # "https://github.com/ultralytics/assets/releases/download/v0.0.0/VisDrone2019-DET-test-challenge.zip",
      ]
      download(urls, dir=dir, threads=4)

      # Convert
      splits = {"VisDrone2019-DET-train": "train", "VisDrone2019-DET-val": "val", "VisDrone2019-DET-test-dev": "test"}
      for folder, split in splits.items():
          visdrone2yolo(dir, split, folder)  # convert VisDrone annotations to YOLO labels
          shutil.rmtree(dir / folder)  # cleanup original directory

## Usage

To train a YOLO11n model on the VisDrone dataset for 100 epochs with an image size of 640, you can use the following code snippets. For a comprehensive list of available arguments, refer to the model Training page.

Train Example

Python CLI

    from ultralytics import YOLO

    # Load a model
    model = YOLO("yolo11n.pt")  # load a pretrained model (recommended for training)

    # Train the model
    results = model.train(data="VisDrone.yaml", epochs=100, imgsz=640)

    # Start training from a pretrained *.pt model
    yolo detect train data=VisDrone.yaml model=yolo11n.pt epochs=100 imgsz=640

## Sample Data and Annotations

The VisDrone dataset contains a diverse set of images and videos captured by drone-mounted cameras. Here are some examples of data from the dataset, along with their corresponding annotations:

- Task 1: Object detection in images - This image demonstrates an example of object detection in images, where objects are annotated with bounding boxes. The dataset provides a wide variety of images taken from different locations, environments, and densities to facilitate the development of models for this task.

The example showcases the variety and complexity of the data in the VisDrone dataset and highlights the importance of high-quality sensor data for drone-based computer vision tasks.

## Citations and Acknowledgments

If you use the VisDrone dataset in your research or development work, please cite the following paper:

BibTeX

    @ARTICLE{9573394,
      author={Zhu, Pengfei and Wen, Longyin and Du, Dawei and Bian, Xiao and Fan, Heng and Hu, Qinghua and Ling, Haibin},
      journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
      title={Detection and Tracking Meet Drones Challenge},
      year={2021},
      volume={},
      number={},
      pages={1-1},
      doi={10.1109/TPAMI.2021.3119563}}

We would like to acknowledge the AISKYEYE team at the Lab of Machine Learning and Data Mining, Tianjin University, China, for creating and maintaining the VisDrone dataset as a valuable resource for the drone-based computer vision research community. For more information about the VisDrone dataset and its creators, visit the VisDrone Dataset GitHub repository.

## FAQ

### What is the VisDrone Dataset and what are its key features?

The VisDrone Dataset is a large-scale benchmark created by the AISKYEYE team at Tianjin University, China. It is designed for various computer vision tasks related to drone-based image and video analysis. Key features include:

- Composition: 288 video clips with 261,908 frames and 10,209 static images.
- Annotations: Over 2.6 million bounding boxes for objects like pedestrians, cars, bicycles, and tricycles.
- Diversity: Collected across 14 cities, in urban and rural settings, under different weather and lighting conditions.
- Tasks: Split into five main tasks—object detection in images and videos, single-object and multi-object tracking, and crowd counting.

### How can I use the VisDrone Dataset to train a YOLO11 model with Ultralytics?

To train a YOLO11 model on the VisDrone dataset for 100 epochs with an image size of 640, you can follow these steps:

Train Example

Python CLI

    from ultralytics import YOLO

    # Load a pretrained model
    model = YOLO("yolo11n.pt")

    # Train the model
    results = model.train(data="VisDrone.yaml", epochs=100, imgsz=640)

    # Start training from a pretrained *.pt model
    yolo detect train data=VisDrone.yaml model=yolo11n.pt epochs=100 imgsz=640

For additional configuration options, please refer to the model Training page.

### What are the main subsets of the VisDrone dataset and their applications?

The VisDrone dataset is divided into five main subsets, each tailored for a specific computer vision task:

1. Task 1: Object detection in images.
2. Task 2: Object detection in videos.
3. Task 3: Single-object tracking.
4. Task 4: Multi-object tracking.
5. Task 5: Crowd counting.

These subsets are widely used for training and evaluating deep learning models in drone-based applications such as surveillance, traffic monitoring, and public safety.

### Where can I find the configuration file for the VisDrone dataset in Ultralytics?

The configuration file for the VisDrone dataset, `VisDrone.yaml`, can be found in the Ultralytics repository at the following link: VisDrone.yaml.

### How can I cite the VisDrone dataset if I use it in my research?

If you use the VisDrone dataset in your research or development work, please cite the following paper:

BibTeX

    @ARTICLE{9573394,
      author={Zhu, Pengfei and Wen, Longyin and Du, Dawei and Bian, Xiao and Fan, Heng and Hu, Qinghua and Ling, Haibin},
      journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
      title={Detection and Tracking Meet Drones Challenge},
      year={2021},
      volume={},
      number={},
      pages={1-1},
      doi={10.1109/TPAMI.2021.3119563}
    }

📅 Created 1 year ago ✏️ Updated 6 months ago

## Comments