Skip to content

Commit

Permalink
File rename: nwpu.py -> vhr10.py (microsoft#1030)
Browse files Browse the repository at this point in the history
* File rename: nwpu.py -> vhr10.py

* Update more locations

* Name change in several other places

* Add NWPU only to docstring

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
  • Loading branch information
adamjstewart and calebrob6 committed Jan 23, 2023
1 parent 3c15ccd commit 391da5b
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ for batch in dataloader:
# train a model, or make predictions using a pre-trained model
```

<img src="https://raw.githubusercontent.com/microsoft/torchgeo/main/images/vhr10.png" alt="Example predictions from a Mask R-CNN model trained on the NWPU VHR-10 dataset"/>
<img src="https://raw.githubusercontent.com/microsoft/torchgeo/main/images/vhr10.png" alt="Example predictions from a Mask R-CNN model trained on the VHR-10 dataset"/>

All TorchGeo datasets are compatible with PyTorch data loaders, making them easy to integrate into existing training workflows. The only difference between a benchmark dataset in TorchGeo and a similar dataset in torchvision is that each dataset returns a dictionary with keys for each PyTorch `Tensor`.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ Vaihingen

.. autoclass:: Vaihingen2D

NWPU VHR-10
^^^^^^^^^^^
VHR-10
^^^^^^

.. autoclass:: VHR10

Expand Down
2 changes: 1 addition & 1 deletion docs/api/non_geo_datasets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Dataset,Task,Source,# Samples,# Classes,Size (px),Resolution (m),Bands
`UC Merced`_,C,USGS National Map,"21,000",21,256x256,0.3,RGB
`USAVars`_,R,NAIP Aerial,100K,-,-,4,"RGB, NIR"
`Vaihingen`_,S,Aerial,33,6,"1,281--3,816",0.09,RGB
`NWPU VHR-10`_,I,"Google Earth, Vaihingen",800,10,"358--1,728",0.08--2,RGB
`VHR-10`_,I,"Google Earth, Vaihingen",800,10,"358--1,728",0.08--2,RGB
`xView2`_,CD,Maxar,"3,732",4,"1,024x1,024",0.8,RGB
`ZueriCrop`_,"I, T",Sentinel-2,116K,48,24x24,10,MSI
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/datasets/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_mock_missing_module(mock_missing_module: None) -> None:
[
os.path.join("cowc_detection", "COWC_Detection_Columbus_CSUAV_AFRL.tbz"),
os.path.join("cowc_detection", "COWC_test_list_detection.txt.bz2"),
os.path.join("nwpu", "NWPU VHR-10 dataset.rar"),
os.path.join("vhr10", "NWPU VHR-10 dataset.rar"),
os.path.join("landcoverai", "landcover.ai.v1.zip"),
os.path.join("chesapeake", "BAYWIDE", "Baywide_13Class_20132014.zip"),
os.path.join("sen12ms", "ROIs1158_spring_lc.tar.gz"),
Expand All @@ -107,7 +107,7 @@ def test_missing_rarfile(mock_missing_module: None) -> None:
match="rarfile is not installed and is required to extract this dataset",
):
extract_archive(
os.path.join("tests", "data", "nwpu", "NWPU VHR-10 dataset.rar")
os.path.join("tests", "data", "vhr10", "NWPU VHR-10 dataset.rar")
)


Expand Down
6 changes: 3 additions & 3 deletions tests/datasets/test_nwpu.py → tests/datasets/test_vhr10.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def dataset(
self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest
) -> VHR10:
pytest.importorskip("rarfile", minversion="3")
monkeypatch.setattr(torchgeo.datasets.nwpu, "download_url", download_url)
monkeypatch.setattr(torchgeo.datasets.vhr10, "download_url", download_url)
monkeypatch.setattr(torchgeo.datasets.utils, "download_url", download_url)
url = os.path.join("tests", "data", "nwpu", "NWPU VHR-10 dataset.rar")
url = os.path.join("tests", "data", "vhr10", "NWPU VHR-10 dataset.rar")
monkeypatch.setitem(VHR10.image_meta, "url", url)
md5 = "5fddb0dfd56a80638831df9f90cbf37a"
monkeypatch.setitem(VHR10.image_meta, "md5", md5)
url = os.path.join("tests", "data", "nwpu", "annotations.json")
url = os.path.join("tests", "data", "vhr10", "annotations.json")
monkeypatch.setitem(VHR10.target_meta, "url", url)
md5 = "833899cce369168e0d4ee420dac326dc"
monkeypatch.setitem(VHR10.target_meta, "md5", md5)
Expand Down
2 changes: 1 addition & 1 deletion torchgeo/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
from .millionaid import MillionAID
from .naip import NAIP
from .nasa_marine_debris import NASAMarineDebris
from .nwpu import VHR10
from .openbuildings import OpenBuildings
from .oscd import OSCD
from .patternnet import PatternNet
Expand Down Expand Up @@ -105,6 +104,7 @@
unbind_samples,
)
from .vaihingen import Vaihingen2D
from .vhr10 import VHR10
from .xview import XView2
from .zuericrop import ZueriCrop

Expand Down
2 changes: 1 addition & 1 deletion torchgeo/datasets/resisc45.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class RESISC45(NonGeoClassificationDataset):
"""RESISC45 dataset.
"""NWPU-RESISC45 dataset.
The `RESISC45 <http://www.escience.cn/people/JunweiHan/NWPU-RESISC45.html>`__
dataset is a dataset for remote sensing image scene classification.
Expand Down
File renamed without changes.

0 comments on commit 391da5b

Please sign in to comment.