はじめる

OBB付きDOTAデータセット

DOTAデータセットは、航空画像の物体検出における大規模ベンチマークで、3つのバージョン(v1.0、v1.5、v2.0)が公開されています。多様な航空センサーやプラットフォームで撮影された画像に対し、18カテゴリにわたる最大170万件の回転バウンディングボックス(OBB)アノテーションが含まれています。

Ultralytics Platformで公式にホストされているDOTA v1.5およびDOTA v1.0データセットを確認し、回転アノテーションをプレビューしたり、統計を調べたり、複製してトレーニングに利用したりできます。

航空画像検出向けDOTAデータセットの物体クラス

主な機能#



視聴: Google Colab で DOTA データセットを使って Ultralytics YOLO をトレーニングし、回転バウンディングボックスを扱う方法
  • さまざまなセンサーやプラットフォームから収集されており、画像サイズは800 × 800ピクセルから20,000 × 20,000ピクセルまであります。
  • 18カテゴリにわたる170万件以上の回転バウンディングボックスを含みます。
  • 画像ごとの物体サイズの幅が広いため、マルチスケール物体検出に対応しています。
  • インスタンスには専門家が任意の四辺形(自由度8)でアノテーションを付与し、さまざまなスケール、向き、形状の物体を捉えています。

データセットのバージョン#

DOTA-v1.0#

  • 一般的な15カテゴリが含まれています。
  • 2,806枚の画像と188,282件のインスタンスで構成されています。
  • 分割比率:トレーニング用が1/2(1,411枚)、検証用が1/6(458枚)、テスト用が1/3(937枚)です。

DOTA-v1.5#

  • DOTA-v1.0と同じ画像を使用しています。
  • 10ピクセル未満の非常に小さなインスタンスにもアノテーションが付与されています。
  • 新しいカテゴリ「コンテナクレーン」が追加されています。
  • インスタンスの合計は403,318件です。
  • 2019年の航空画像物体検出に関するDOAIチャレンジ向けに公開されました。

DOTA-v2.0#

  • Google Earth、GF-2衛星、その他の航空画像から収集されています。
  • 一般的な18カテゴリが含まれています。
  • 11,268枚の画像と1,793,658個のインスタンスで構成されています。
  • 新たに「空港」と「ヘリポート」のカテゴリが追加されています。
  • 画像の分割:
    • トレーニング: 1,830枚の画像、268,627個のインスタンス。
    • 検証: 593枚の画像、81,048個のインスタンス。
    • Test-dev: 2,792枚の画像、353,346個のインスタンス。
    • Test-challenge: 6,053枚の画像、1,090,637個のインスタンス。

データセットの構成#

DOTAは、OBB物体検出の課題に特化した構造化レイアウトを採用しています。

  • 画像: 多様な地形や構造物を捉えた、高解像度の航空画像を豊富に収録しています。
  • 回転バウンディングボックス: 物体の向きにかかわらず物体を囲む、回転した矩形形式のアノテーションです。飛行機、船舶、建物などの物体の捉え方に適しています。

用途#

DOTAは、航空画像分析向けに構築されたモデルのトレーニングと評価に使用されるベンチマークです。有向バウンディングボックスのアノテーションにより、回転した密集対象物を扱う物体検出モデルにとって、難易度の高いテストになります。このデータセットは、リモートセンシング、監視、環境モニタリングで広く使用されています。

データセットYAML#

データセットのYAMLファイルでは、画像とラベルのルート、クラス名、その他の重要なメタデータを指定します。Ultralyticsは、最も広く使われている2つのリリース向けに公式YAMLファイルを管理しています。

ダウンロードしたリリースに対応するYAMLを使用してください。DOTA-v2やその他の派生版を使用する場合は、カスタムYAMLを作成してください。どちらのリリースも、初回のトレーニング時にUltralyticsのGitHubアセットから自動的にダウンロードされます(2 GB)。

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

# DOTA 1.0 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University
# Documentation: https://docs.ultralytics.com/datasets/obb/dota-v2
# Example usage: yolo train model=yolov8n-obb.pt data=DOTAv1.yaml
# parent
# ├── ultralytics
# └── datasets
#     └── DOTAv1 ← downloads here (2 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: DOTAv1 # dataset root dir
train: images/train # train images (relative to 'path') 1411 images
val: images/val # val images (relative to 'path') 458 images
test: images/test # test images (optional) 937 images

# Classes for DOTA 1.0
names:
  0: plane
  1: ship
  2: storage tank
  3: baseball diamond
  4: tennis court
  5: basketball court
  6: ground track field
  7: harbor
  8: bridge
  9: large vehicle
  10: small vehicle
  11: helicopter
  12: roundabout
  13: soccer ball field
  14: swimming pool

# Download script/URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/DOTAv1.zip

DOTA画像の分割#

元画像は一辺が10,000ピクセルを超えることが多いため、YOLOにデータを渡す前にタイル分割することをおすすめします。以下のヘルパーを使用すると、アノテーションとの対応を保ちながら、元画像を複数のスケールで重なり合う1024 × 1024のクロップ画像に分割できます。

画像を分割
from ultralytics.data.split_dota import split_test, split_trainval

# ラベル付きでトレーニングセットと検証セットを分割します。
split_trainval(
    data_root="path/to/DOTAv1.0/",
    save_dir="path/to/DOTAv1.0-split/",
    rates=[0.5, 1.0, 1.5],  # multiscale
    gap=500,
)
# ラベルなしでテストセットを分割します。
split_test(
    data_root="path/to/DOTAv1.0/",
    save_dir="path/to/DOTAv1.0-split/",
    rates=[0.5, 1.0, 1.5],  # multiscale
    gap=500,
)
ヒント

出力ディレクトリは標準的なYOLOのレイアウト(images/train、labels/trainなど)に整理し、データセットYAMLから直接参照できるようにしてください。

使用方法#

DOTA v1データセットでYOLO26n-obbモデルをトレーニングするには、次のコードスニペットを使用してください。使用可能な引数の詳細については、必ずモデルのドキュメントを参照してください。まず小規模なサブセットで試したい場合は、クイックテスト用の画像が8枚だけ含まれ、Ultralytics Platformで閲覧できるDOTA8データセットを使用してください。

ライセンスとデータセットの出所

DOTAv1データセットに含まれるすべての画像と関連するアノテーションは、学術目的に限って使用でき、商用利用は禁止されています。Ultralyticsは、これらの制限は事前学習済みまたはファインチューニング済みのモデルの重みにではなく、ソースデータセットに適用されると解釈しています。使用目的に応じて、DOTAの利用規約をご確認ください。

トレーニング例
from ultralytics import YOLO

# 事前学習済みのYOLO26n-OBBモデルを読み込む
model = YOLO("yolo26n-obb.pt")

# DOTAv1データセットでモデルをトレーニングする
results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=1024)

サンプルデータとアノテーション#

以下のサンプルは、DOTAの代表的なシーンとアノテーションを示しています。

方向付きバウンディングボックスのアノテーションを含むDOTAデータセット

  • DOTAの例: このスナップショットは、航空シーンの複雑さと、物体を自然な向きで捉える方向付きバウンディングボックスアノテーションの重要性を示しています。

これらのシーンは、航空画像に特有の検出課題を示しています。DOTA-v2.0は、包括的なアノテーションと多様な物体カテゴリを備えているため、リモートセンシングや航空監視プロジェクトで広く使用されています。

引用と謝辞#

業務でDOTAを使用する場合は、関連する研究論文を引用してください。

引用
@article{9560031,
  author={Ding, Jian and Xue, Nan and Xia, Gui-Song and Bai, Xiang and Yang, Wen and Yang, Michael and Belongie, Serge and Luo, Jiebo and Datcu, Mihai and Pelillo, Marcello and Zhang, Liangpei},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  title={Object Detection in Aerial Images: A Large-Scale Benchmark and Challenges},
  year={2022},
  volume={44},
  number={11},
  pages={7778-7796},
  doi={10.1109/TPAMI.2021.3117983}
}

DOTAデータセットを整備してくださったチームに感謝します。データセットの詳細については、DOTA公式ウェブサイトをご覧ください。

よくある質問#

  • DOTAデータセットは、航空画像の物体検出に特化したデータセットです。方向付きバウンディングボックス(OBB)を採用し、多様な航空シーンの画像にアノテーションを付与しています。170万件のアノテーションと18のカテゴリにわたり、物体の向き、スケール、形状が多様なDOTAは、監視、環境モニタリング、災害管理などの航空画像解析に特化したモデルの開発と評価に適しています。

  • DOTAではアノテーションに有向バウンディングボックス(OBB)を使用します。これは、向きに関係なく物体を囲む回転した矩形で表されます。この方法により、小さな物体やさまざまな角度の物体を正確に捉えられます。800 × 800から20,000 × 20,000ピクセルまでのマルチスケール画像を含むこのデータセットでは、小さな物体から大きな物体まで効果的に検出できます。このアプローチは、物体がさまざまな角度やスケールで写る航空画像で特に有用です。

  • Ultralytics YOLOを使った以下の例を参考に、DOTAデータセットでモデルをトレーニングできます。

    トレーニング例
    from ultralytics import YOLO
    
    # 事前学習済みのYOLO26n-OBBモデルを読み込む
    model = YOLO("yolo26n-obb.pt")
    
    # DOTAv1データセットでモデルをトレーニングする
    results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=1024)

    DOTA画像の分割と前処理の詳細については、DOTA画像の分割セクションを参照してください。

    • DOTA-v1.0: 2,806枚の画像に、15の一般的なカテゴリと188,282個のインスタンスを含みます。データセットはトレーニング、検証、テストの各セットに分割されています。
    • DOTA-v1.5: DOTA-v1.0を基に、非常に小さなインスタンス(10ピクセル未満)にアノテーションを付与し、「コンテナクレーン」という新しいカテゴリを追加しており、合計403,318個のインスタンスを収録しています。
    • DOTA-v2.0: Google EarthとGF-2衛星からのアノテーションを追加してさらに拡張され、11,268枚の画像と1,793,658個のインスタンスを収録しています。「空港」や「ヘリポート」などの新しいカテゴリも含まれています。

    詳細な比較と追加情報については、データセットのバージョンのセクションをご確認ください。

  • DOTA画像は非常に大きい場合があるため、トレーニングで扱いやすいサイズに分割します。画像を分割するPythonスニペットを以下に示します。

    例
    from ultralytics.data.split_dota import split_test, split_trainval
    
    # ラベル付きでトレーニングセットと検証セットを分割します。
    split_trainval(
        data_root="path/to/DOTAv1.0/",
        save_dir="path/to/DOTAv1.0-split/",
        rates=[0.5, 1.0, 1.5],  # multiscale
        gap=500,
    )
    # ラベルなしでテストセットを分割します。
    split_test(
        data_root="path/to/DOTAv1.0/",
        save_dir="path/to/DOTAv1.0-split/",
        rates=[0.5, 1.0, 1.5],  # multiscale
        gap=500,
    )

    この処理により、トレーニング効率とモデルの性能が向上します。詳しい手順については、DOTA画像の分割セクションをご覧ください。

コメント17

質問したり、結果を共有したり、ほかの人をサポートしたりできます。

  1. XWP-PPPGitHub

    May I ask how you converted the inference results from YOLOV8 OBB into inference results that can be uploaded to DOTA's Task 1 server? I saved the final inference results of the model in the form of xyxyxy and uploaded them via email. However, the mAP results provided on YOLO's official website differ significantly. I would like to know the reason for this. Can you provide me with a conversion code to convert the test image set into a result that can be uploaded to DOTA's Task 1 server? Thank you very much for your help!

    1
    1. Paula DerrengerUltralytics(編集済み)

      @XWP-PPP hi there!

      DOTA's Task 1 server expects a zip of one text file per class (Task1_plane.txt, Task1_storage-tank.txt, ...), where each line is imgname score x1 y1 x2 y2 x3 y3 x4 y4, with the image name given without extension. OBB results are stored in result.obb, not result.boxes. Here is a snippet that builds those files:

      import shutil
      from collections import defaultdict
      from pathlib import Path
      
      from ultralytics import YOLO
      
      # Load your trained YOLO26-OBB model
      model = YOLO("path/to/your/yolo26n-obb.pt")
      
      # Collect one DOTA Task1 line per detection: imgname score x1 y1 x2 y2 x3 y3 x4 y4 (pixels)
      category_results = defaultdict(list)
      for r in model.predict(source="path/to/test/images", stream=True):
          img_name = Path(r.path).stem
          for cls, conf, pts in zip(r.obb.cls.int().tolist(), r.obb.conf.tolist(), r.obb.xyxyxyxy.flatten(1).tolist()):
              coords = " ".join(f"{p:.1f}" for p in pts)
              category_results[f"Task1_{model.names[cls].replace(' ', '-')}.txt"].append(f"{img_name} {conf:.6f} {coords}\n")
      
      # Save one file per category and zip the submission folder
      output_dir = Path("submission")
      output_dir.mkdir(exist_ok=True)
      for category_file, lines in category_results.items():
          (output_dir / category_file).write_text("".join(lines))
      shutil.make_archive("submission", "zip", output_dir)

      Upload submission.zip to the DOTA Task 1 server. If your mAP differs from your local validation, check that image names match the test set and that the coordinates are in pixels of the original (unsplit) images. For more details, see the DOTA Dataset Documentation. Happy coding! 😊

  2. Taufiq-Ahmed-prantoGitHub

    Hi, I want to use the DOTA dataset only for YOLOv11 Nano. I don't want to use the model with oriented bounding boxes (OBB). What is the procedure?

  3. Jie Liu

    I have download dotav1 form https://github.com/ultralytics/assets/releases/download/v0.0.0/DOTAv1.zip and use script split dataset.

    from ultralytics.data.split_dota import split_test, split_trainval
    
    # split train and val set, with labels.
    split_trainval(
        data_root="/dataset/coco/DOTAv1",
        save_dir="/dataset/coco/DOTAv1.0-split/",
        rates=[0.5, 1.0, 1.5],  # multiscale
        gap=500,
    )
    # split test set, without labels.
    split_test(
        data_root="/dataset/coco/DOTAv1/",
        save_dir="/dataset/coco/DOTAv1.0-split/",
        rates=[0.5, 1.0, 1.5],  # multiscale
        gap=500,
    )

    how to reproduce yolov11 obb result, please show me the command like

    yolo train model=ultralytics-8.3.13/ultralytics/cfg/models/11/yolo11n-obb.yaml data=DOTAv1/DOTAv1.yaml epochs=500 batch=32*4 imgsz=640 device=4,5,6,7 cache=disk amp=True
    1. Glenn JocherUltralytics(編集済み)

      @keeper-jie for training YOLO26-OBB on DOTAv1 after splitting, use this command with your 4 GPUs:
      yolo obb train data=DOTAv1.yaml model=yolo26n-obb.pt epochs=500 imgsz=1024 batch=128 device=4,5,6,7

      Key parameters from our DOTA documentation:

      • imgsz=1024 (matches dataset's multiscale split)
      • Use official model name yolo26n-obb.pt rather than YAML path
      • Batch size 128 (32*4 GPUs) via batch=128

      Ensure your dataset YAML paths point to the split images directory.

  4. huynhkhoa44GitHub

    I have labeled data in YOLOv8 object detection format, our label data format is already rotated rectangles to the correct angle of the object, however since it is in YOLOv8 object detection format, the "angle" parameter is missing. I no longer keep the label folder on CVAT so I cannot export to a different label format. Is there a way to add the angle value from the 4 pre-existing <x_center> <y_center> values?

    1. Glenn JocherUltralytics

      To add the angle value from your existing YOLOv8 labels, you'll need to calculate it based on the coordinates. Unfortunately, without the original CVAT labels, this requires manual computation or using a tool that supports angle annotations. For guidance on datasets with oriented bounding boxes, you can refer to the DOTA dataset documentation at https://docs.ultralytics.com/datasets/obb/dota-v2/.

  5. jack-readyGitHub

    Recently, I've been using YOLOv8 to train the DOTAv1 dataset and encountered some issues. I was wondering if I could seek advice. 1.To train the DOTA dataset, we split the original DOTA images with high-resolution into images with 1024x1024. I noticed that the provided segmentation code provides three sizes, rates=[0.5, 1.0, 1.5]. In order to obtain 1024×1024 images, it seems that we should choose rates=1, but I noticed that some images in the segmentation results of the validation set are smaller than 1024×1024, such as 1024×1023, 824*1024, etc. What is the reason for this?Will it affect the experiment? 2.Another issue arises during the training process. I noticed that the training process conducts validation after each epoch. I attempted to disable validation by setting val=False, but it seems to have no effect. What could be the reason for this? The training code snippet is as follows: results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=640, batch=10, workers=0, val=False). Additionally, during validation, it seems that the images are not being resized to 640. Printing the results in the code yields torch.Size([10, 3, 672, 672]), whereas during the training process, images are correctly resized to 640. Could someone help me understand this?

    1. Glenn JocherUltralytics(編集済み)

      @jack-ready hi there!

      Thank you for reaching out with your questions regarding training the DOTA dataset with YOLOv8. Let's address each of your concerns:

      1. Image Splitting and Sizes: When splitting high-resolution DOTA images into 1024x1024 segments using rates=[0.5, 1.0, 1.5], you might notice some resulting images are slightly smaller than 1024x1024 (e.g., 1024x1023 or 824x1024). This occurs due to the way the splitting algorithm handles the edges of the original images. If the original image dimensions are not perfectly divisible by 1024, the last segment in each row or column might be smaller. This should not significantly affect your experiment as long as the majority of your data maintains the expected size. However, you can ensure consistency by padding these smaller images to 1024x1024 if necessary.

      2. Disabling Validation: The val=False argument should indeed disable validation during training. If it doesn't seem to work, please ensure you are using the latest version of the Ultralytics package. You can update it using:

        pip install --upgrade ultralytics

        If the issue persists, providing a minimum reproducible example would be very helpful for us to diagnose the problem. You can find guidance on creating one here: Minimum Reproducible Example.

      3. Image Resizing During Validation: The discrepancy in image sizes during validation (e.g., torch.Size([10, 3, 672, 672]) instead of 640) might be due to the model's internal resizing logic. Ensure that the imgsz parameter is correctly set for both training and validation. Validation uses the same imgsz as training, so set it explicitly in your training script:

        results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=640, batch=10, workers=0, val=True)

      I hope this helps! If you have any further questions or need additional assistance, feel free to ask. Happy training! 🚀

    2. jack-readyGitHub

      Thank you very much for your help. I have another question regarding the YOLOV8 training on the DOTA v1.0 dataset. I would like to know how to set the training parameters, such as learning rate, optimizer, and loss function. When I try to reproduce the results, my mAP50 is about 74%, but it does not reach 78%. I would greatly appreciate any assistance you can provide.Below is my training code. from ultralytics import YOLO model = YOLO("yolov8n-obb.yaml") model.load("yolov8n-obb.pt") model = YOLO("yolov8n-obb.yaml").load("yolov8n.pt") results = model.train(data="DOTAv1.yaml", epochs=100, imgsz=640, batch=48, workers=0,project="runs/DOTAV1.0",val=True,resume=True)

    3. Glenn JocherUltralytics(編集済み)

      Hi there! Glad to help with your training setup. To fine-tune your training parameters for better mAP50 results, you can adjust the learning rate, optimizer, and loss function. For instance, you might try a lower learning rate or switch to a different optimizer like Adam. Here's a quick example:

      from ultralytics import YOLO
      
      model = YOLO("yolo26n-obb.yaml").load("yolo26n-obb.pt")
      results = model.train(
          data="DOTAv1.yaml", 
          epochs=100, 
          imgsz=640, 
          batch=48, 
          workers=0, 
          project="runs/DOTAV1.0", 
          val=True, 
          lr0=0.001,  # Adjust learning rate
          optimizer='Adam'  # Change optimizer
      )

      Ensure you're using the latest version of the Ultralytics package to avoid any bugs. If you still face issues, feel free to share more details. Happy training! 🚀

  6. Tintin26100GitHub

    How can I find the number of instances per class in DOTA v1.5 ? I've been searching for this information for a moment and I can't find any answers

    1. Paula DerrengerUltralytics

      @Tintin26100 hello!

      The number of instances per class in DOTA v1.5 isn't directly listed in the dataset's summary. However, you can obtain this information by analyzing the annotation files provided with the dataset. Each object instance in these files is labeled with a class, and you can count the number of times each class appears.

      If you need further guidance on how to process these annotation files or any other assistance with the DOTA dataset, feel free to ask!

      Happy coding! 😊

    2. Tintin26100GitHub

      Hi, thanks for your quick answer, I will gladly accept your help because I don't really know what to do to extract those informations, where do you find the annotation files ? Is it on the github ? If it is what's it's path ? Thanks for the time you spend helping

    3. Paula DerrengerUltralytics

      @Tintin26100 hello!

      The annotation files for the DOTA dataset are typically included within the dataset download itself. These files contain the details for each instance, including class labels and oriented bounding box coordinates.

      For the DOTA v1.5 dataset, you can find these files in the dataset directory after you download it from the official DOTA dataset page or the provided download link in the dataset's YAML configuration file. The path to the annotations will usually be structured under the labels or annotations directory within the main dataset folder.

      If you've already downloaded the dataset, you should look for .txt or .json files corresponding to each image in the dataset, which contain the annotations. If you need further assistance navigating these files or extracting specific data, feel free to ask!

      Thank you for reaching out, and happy analyzing! 😊

    1. Glenn JocherUltralytics(編集済み)

      Hey there! 😊 Testing the DOTA dataset online using YOLO26-obb is quite straightforward. If you've already prepared your dataset according to the Ultralytics guidelines and split the images, here's a simple example to get you started with training:

      # Train a YOLO26n-OBB model on the DOTA v1 dataset
      yolo obb train data=DOTAv1.yaml model=yolo26n-obb.pt epochs=100 imgsz=640

      This command uses DOTA v1 and the corresponding .yaml file (DOTAv1.yaml) describing your dataset paths and classes. Adjust epochs and imgsz based on your needs.

      Just make sure to check out the DOTA dataset page on Ultralytics docs for more info on dataset preparation and additional configurations! Happy detecting! 🚀