VHR-10#
- class torchgeo.datasets.VHR10(root='data', split='positive', transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetNWPU VHR-10 dataset.
Northwestern Polytechnical University (NWPU) very-high-resolution ten-class (VHR-10) remote sensing image dataset.
Consists of 800 VHR optical remote sensing images, where 715 color images were acquired from Google Earth with the spatial resolution ranging from 0.5 to 2 m, and 85 pansharpened color infrared (CIR) images were acquired from Vaihingen data with a spatial resolution of 0.08 m.
The data set is divided into two sets:
Positive image set (650 images) which contains at least one target in an image
Negative image set (150 images) does not contain any targets
The positive image set consists of objects from ten classes:
Airplanes (757)
Ships (302)
Storage tanks (655)
Baseball diamonds (390)
Tennis courts (524)
Basketball courts (159)
Ground track fields (163)
Harbors (224)
Bridges (124)
Vehicles (477)
Includes object detection bounding boxes from original paper and instance segmentation masks from follow-up publications. If you use this dataset in your research, please cite the following papers:
Note
This dataset requires the following additional library to be installed:
pycocotools to load the
annotations.jsonfile for the “positive” image set
- __init__(root='data', split='positive', transforms=None, download=False, checksum=False)[source]#
Initialize a new VHR-10 dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – one of “positive” or “negative”
transforms (Callable[[dict[str, Any]], dict[str, Any]] | None) – a function/transform that takes input sample and its target as entry and returns a transformed version
download (bool) – if True, download dataset and store it in the root directory
checksum (bool) – if True, check the MD5 of the downloaded files (may be slow)
- Raises:
AssertionError – if
splitargument is invalidDatasetNotFoundError – If dataset is not found and download is False.
DependencyNotFoundError – if
split="positive"and pycocotools is not installed.
- __len__()[source]#
Return the number of data points in the dataset.
- Returns:
length of the dataset
- Return type:
- plot(sample, show_titles=True, suptitle=None, show_feats='both', box_alpha=0.7, mask_alpha=0.7)[source]#
Plot a sample from the dataset.
- Parameters:
sample (dict[str, Any]) – a sample returned by
__getitem__()suptitle (str | None) – optional string to use as a suptitle
show_titles (bool) – flag indicating whether to show titles above each panel
show_feats (str | None) – optional string to pick features to be shown: boxes, masks, both
box_alpha (float) – alpha value of box
mask_alpha (float) – alpha value of mask
- Returns:
a matplotlib Figure with the rendered sample
- Raises:
AssertionError – if
show_featsargument is invalidDependencyNotFoundError – If plotting masks and scikit-image is not installed.
- Return type:
Added in version 0.4.
- __annotate_func__()#
The type of the None singleton.