xViewデータセット
xViewデータセットは、上空からの画像に関する公開されている最大のデータセットの1つであり、世界中の複雑なシーンからの画像がバウンディングボックスを使用してアノテーションされています。xViewデータセットの目標は、次の4つのコンピュータビジョンのフロンティアにおける進歩を加速することです。
- 検出のための最小解像度を下げます。
- 学習効率を向上させます。
- より多くのオブジェクトクラスの検出を有効にします。
- 微細なクラスの検出を改善します。
xViewは、Common Objects in Context (COCO)のようなチャレンジの成功に基づいて構築されており、コンピュータビジョンを活用して、宇宙からの利用可能な画像量の増加を分析し、新しい方法で視覚世界を理解し、さまざまな重要なアプリケーションに対応することを目指しています。
手動ダウンロードが必要
xView データセットは、Ultralytics スクリプトによって自動的にダウンロードされません。最初に公式ソースからデータセットを手動でダウンロードする必要があります:
- ソース: 米国国家地理空間情報局(NGA)によるDIUx xView 2018チャレンジ
- URL: https://challenge.xviewdataset.org
重要: 必要なファイル(例: train_images.tif
, val_images.tif
, xView_train.geojson
) は、それらを解凍し、正しいディレクトリ構造(通常は下にあると予想される)に配置する必要があります。 datasets/xView/
フォルダ、 前に 以下に示すトレーニングコマンドを実行します。データセットがチャレンジの指示に従って適切にセットアップされていることを確認してください。
主な特徴
- xViewには、60のクラスにわたって100万を超えるオブジェクトインスタンスが含まれています。
- データセットの解像度は0.3メートルで、ほとんどの公開されている衛星画像データセットよりも高解像度の画像を提供します。
- xViewは、バウンディングボックスアノテーションを備えた、多様な小規模、希少、微細、およびマルチタイプのオブジェクトのコレクションを特徴としています。
- TensorFlowオブジェクト検出APIを使用した、事前トレーニング済みのベースラインモデルと、PyTorchのサンプルが付属しています。
データセットの構造
xViewデータセットは、地上サンプル距離0.3mでWorldView-3衛星から収集された衛星画像で構成されています。1,400 km²を超える画像に、60のクラスにわたる100万を超えるオブジェクトが含まれています。このデータセットは、特にリモートセンシングアプリケーションや環境モニタリングに役立ちます。
アプリケーション
xViewデータセットは、オーバーヘッド画像における物体検出のための深層学習モデルのトレーニングと評価に広く使用されています。このデータセットは、多様な物体クラスと高解像度画像を備えており、コンピュータビジョンの分野、特に衛星画像解析の研究者や実務者にとって貴重なリソースとなっています。アプリケーションには以下が含まれます。
- 軍事および防衛偵察
- 都市計画と開発
- 環境モニタリング
- 災害対応と評価
- インフラのマッピングと管理
データセット YAML
YAML(Yet Another Markup Language)ファイルは、データセットの構成を定義するために使用されます。これには、データセットのパス、クラス、およびその他の関連情報が含まれています。xViewデータセットの場合、 xView.yaml
fileは以下で管理されています: https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/xView.yaml.
ultralytics/cfg/datasets/xView.yaml
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# DIUx xView 2018 Challenge https://challenge.xviewdataset.org by U.S. National Geospatial-Intelligence Agency (NGA)
# -------- DOWNLOAD DATA MANUALLY and jar xf val_images.zip to 'datasets/xView' before running train command! --------
# Documentation: https://docs.ultralytics.com/datasets/detect/xview/
# Example usage: yolo train data=xView.yaml
# parent
# ├── ultralytics
# └── datasets
# └── xView ← downloads here (20.7 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: xView # dataset root dir
train: images/autosplit_train.txt # train images (relative to 'path') 90% of 847 train images
val: images/autosplit_val.txt # train images (relative to 'path') 10% of 847 train images
# Classes
names:
0: Fixed-wing Aircraft
1: Small Aircraft
2: Cargo Plane
3: Helicopter
4: Passenger Vehicle
5: Small Car
6: Bus
7: Pickup Truck
8: Utility Truck
9: Truck
10: Cargo Truck
11: Truck w/Box
12: Truck Tractor
13: Trailer
14: Truck w/Flatbed
15: Truck w/Liquid
16: Crane Truck
17: Railway Vehicle
18: Passenger Car
19: Cargo Car
20: Flat Car
21: Tank car
22: Locomotive
23: Maritime Vessel
24: Motorboat
25: Sailboat
26: Tugboat
27: Barge
28: Fishing Vessel
29: Ferry
30: Yacht
31: Container Ship
32: Oil Tanker
33: Engineering Vehicle
34: Tower crane
35: Container Crane
36: Reach Stacker
37: Straddle Carrier
38: Mobile Crane
39: Dump Truck
40: Haul Truck
41: Scraper/Tractor
42: Front loader/Bulldozer
43: Excavator
44: Cement Mixer
45: Ground Grader
46: Hut/Tent
47: Shed
48: Building
49: Aircraft Hangar
50: Damaged Building
51: Facility
52: Construction Site
53: Vehicle Lot
54: Helipad
55: Storage Tank
56: Shipping container lot
57: Shipping Container
58: Pylon
59: Tower
# Download script/URL (optional) ---------------------------------------------------------------------------------------
download: |
import json
import os
from pathlib import Path
import numpy as np
from PIL import Image
from ultralytics.utils import TQDM
from ultralytics.data.utils import autosplit
from ultralytics.utils.ops import xyxy2xywhn
def convert_labels(fname=Path("xView/xView_train.geojson")):
"""Converts xView geoJSON labels to YOLO format, mapping classes to indices 0-59 and saving as text files."""
path = fname.parent
with open(fname, encoding="utf-8") as f:
print(f"Loading {fname}...")
data = json.load(f)
# Make dirs
labels = Path(path / "labels" / "train")
os.system(f"rm -rf {labels}")
labels.mkdir(parents=True, exist_ok=True)
# xView classes 11-94 to 0-59
xview_class2index = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, 3, -1, 4, 5, 6, 7, 8, -1, 9, 10, 11,
12, 13, 14, 15, -1, -1, 16, 17, 18, 19, 20, 21, 22, -1, 23, 24, 25, -1, 26, 27, -1, 28, -1,
29, 30, 31, 32, 33, 34, 35, 36, 37, -1, 38, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, 46,
47, 48, 49, -1, 50, 51, -1, 52, -1, -1, -1, 53, 54, -1, 55, -1, -1, 56, -1, 57, -1, 58, 59]
shapes = {}
for feature in TQDM(data["features"], desc=f"Converting {fname}"):
p = feature["properties"]
if p["bounds_imcoords"]:
id = p["image_id"]
file = path / "train_images" / id
if file.exists(): # 1395.tif missing
try:
box = np.array([int(num) for num in p["bounds_imcoords"].split(",")])
assert box.shape[0] == 4, f"incorrect box shape {box.shape[0]}"
cls = p["type_id"]
cls = xview_class2index[int(cls)] # xView class to 0-60
assert 59 >= cls >= 0, f"incorrect class index {cls}"
# Write YOLO label
if id not in shapes:
shapes[id] = Image.open(file).size
box = xyxy2xywhn(box[None].astype(np.float), w=shapes[id][0], h=shapes[id][1], clip=True)
with open((labels / id).with_suffix(".txt"), "a", encoding="utf-8") as f:
f.write(f"{cls} {' '.join(f'{x:.6f}' for x in box[0])}\n") # write label.txt
except Exception as e:
print(f"WARNING: skipping one label for {file}: {e}")
# Download manually from https://challenge.xviewdataset.org
dir = Path(yaml["path"]) # dataset root dir
# urls = [
# "https://d307kc0mrhucc3.cloudfront.net/train_labels.zip", # train labels
# "https://d307kc0mrhucc3.cloudfront.net/train_images.zip", # 15G, 847 train images
# "https://d307kc0mrhucc3.cloudfront.net/val_images.zip", # 5G, 282 val images (no labels)
# ]
# download(urls, dir=dir)
# Convert labels
convert_labels(dir / "xView_train.geojson")
# Move images
images = Path(dir / "images")
images.mkdir(parents=True, exist_ok=True)
Path(dir / "train_images").rename(dir / "images" / "train")
Path(dir / "val_images").rename(dir / "images" / "val")
# Split
autosplit(dir / "images" / "train")
使用法
画像サイズ640でxViewデータセットのモデルを100エポックトレーニングするには、次のコードスニペットを使用できます。利用可能な引数の包括的なリストについては、モデルのトレーニングページを参照してください。
学習の例
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="xView.yaml", epochs=100, imgsz=640)
# Start training from a pretrained *.pt model
yolo detect train data=xView.yaml model=yolo11n.pt epochs=100 imgsz=640
サンプルデータとアノテーション
xViewデータセットには、境界ボックスを使用してアノテーションが付けられた多様なオブジェクトセットを含む高解像度衛星画像が含まれています。以下は、データセットからのデータの例と、それに対応するアノテーションです。
- 俯瞰画像: この画像は、俯瞰画像における物体検出の例を示しています。ここでは、物体がバウンディングボックスでアノテーションされています。このデータセットは、このタスクのためのモデル開発を促進するために、高解像度の衛星画像を提供します。
この例は、xViewデータセット内のデータの多様性と複雑さを示しており、物体検出タスクにおける高品質な衛星画像の重要性を強調しています。
関連データセット
衛星画像を使用している場合は、これらの関連データセットも参考にしてください。
- DOTA-v2:航空写真における向きのある物体検出のためのデータセット
- VisDrone: ドローンで撮影された画像における物体検出と追跡のためのデータセット
- Argoverse: 3Dトラッキングアノテーションを備えた自動運転用のデータセット
引用と謝辞
xViewデータセットを研究または開発にご利用の際は、以下の論文を引用してください。
@misc{lam2018xview,
title={xView: Objects in Context in Overhead Imagery},
author={Darius Lam and Richard Kuzma and Kevin McGee and Samuel Dooley and Michael Laielli and Matthew Klaric and Yaroslav Bulatov and Brendan McCord},
year={2018},
eprint={1802.07856},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
コンピュータビジョン研究コミュニティへの貴重な貢献をしていただいたDefense Innovation Unit(DIU)とxViewデータセットの作成者に感謝いたします。xViewデータセットとその作成者の詳細については、xViewデータセットのWebサイトをご覧ください。
よくある質問
xViewデータセットとは何ですか?また、これはコンピュータビジョンの研究にどのように役立ちますか?
xViewデータセットは、高解像度の上空からの画像に関する公開されている最大のコレクションの1つであり、60のクラスにわたって100万を超えるオブジェクトインスタンスが含まれています。検出の最小解像度の削減、学習効率の向上、より多くのオブジェクトクラスの発見、および詳細なオブジェクト検出の推進など、コンピュータビジョン研究のさまざまな側面を強化するように設計されています。
Ultralytics YOLO を使用して xView データセットでモデルをトレーニングするにはどうすればよいですか?
Ultralytics YOLOを使用してxViewデータセットでモデルを学習させるには、次の手順に従います。
学習の例
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="xView.yaml", epochs=100, imgsz=640)
# Start training from a pretrained *.pt model
yolo detect train data=xView.yaml model=yolo11n.pt epochs=100 imgsz=640
詳細な引数と設定については、モデルのトレーニングページを参照してください。
xViewデータセットの主な特徴は何ですか?
xViewデータセットは、その包括的な機能セットにより際立っています。
- 60の異なるクラスにわたる100万を超えるオブジェクトインスタンス。
- 0.3メートルの高解像度画像。
- 小さいオブジェクト、珍しいオブジェクト、微細なオブジェクトなど、多様なオブジェクトタイプが、すべてバウンディングボックスでアノテーションされています。
- TensorFlowとPyTorchで事前学習済みのベースラインモデルとサンプルが利用可能です。
xViewのデータセット構造とは何ですか?また、どのようにアノテーションされていますか?
xView データセットには、WorldView-3 衛星によってキャプチャされた高解像度衛星画像が含まれており、0.3m の地上サンプル距離で、約 1,400 km² の注釈付き画像内の 60 の異なるクラスにわたる 100 万を超えるオブジェクトをカバーしています。各オブジェクトにはバウンディングボックスでラベルが付けられており、オーバーヘッドビューでのオブジェクト検出のための深層学習モデルのトレーニングと評価に非常に適したデータセットとなっています。詳細な内訳については、データセット構造のセクションを参照してください。
研究でxViewデータセットを引用するにはどうすればよいですか?
xViewデータセットを研究にご利用の際は、以下の論文を引用してください。
@misc{lam2018xview,
title={xView: Objects in Context in Overhead Imagery},
author={Darius Lam and Richard Kuzma and Kevin McGee and Samuel Dooley and Michael Laielli and Matthew Klaric and Yaroslav Bulatov and Brendan McCord},
year={2018},
eprint={1802.07856},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
xViewデータセットの詳細については、公式のxViewデータセットのウェブサイトをご覧ください。