Skip to content

Commit

Permalink
Rename nwpu_vhr10 to vhr10
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Oct 14, 2022
1 parent 35f34cb commit 8acd267
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions conf/nwpu_vhr10.yaml → conf/vhr10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ trainer:
benchmark: True

experiment:
task: "nwpu_vhr10"
name: "nwpu_vhr10_test"
task: "vhr10"
name: "vhr10_test"
module:
detection_model: "faster-rcnn"
backbone: "resnet50"
Expand Down
2 changes: 1 addition & 1 deletion tests/conf/nwpu_vhr10.yaml → tests/conf/vhr10.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

experiment:
task: "nwpu_vhr10"
task: "vhr10"
module:
detection_model: "faster-rcnn"
backbone: "resnet18"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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", "vhr10", "NWPU VHR-10 dataset.rar")
monkeypatch.setitem(VHR10.image_meta, "url", url)
Expand Down
2 changes: 1 addition & 1 deletion tests/trainers/test_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestObjectDetectionTask:
"name,classname",
[
("nasa_marine_debris", NASAMarineDebrisDataModule),
("nwpu_vhr10", VHR10DataModule),
("vhr10", VHR10DataModule),
],
)
def test_trainer(self, name: str, classname: Type[LightningDataModule]) -> None:
Expand Down
2 changes: 1 addition & 1 deletion torchgeo/datamodules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from .loveda import LoveDADataModule
from .naip import NAIPChesapeakeDataModule
from .nasa_marine_debris import NASAMarineDebrisDataModule
from .nwpu import VHR10DataModule
from .oscd import OSCDDataModule
from .potsdam import Potsdam2DDataModule
from .resisc45 import RESISC45DataModule
Expand All @@ -25,6 +24,7 @@
from .ucmerced import UCMercedDataModule
from .usavars import USAVarsDataModule
from .vaihingen import Vaihingen2DDataModule
from .vhr10 import VHR10DataModule
from .xview import XView2DataModule

__all__ = (
Expand Down
File renamed without changes.
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 @@ -104,6 +103,7 @@
unbind_samples,
)
from .vaihingen import Vaihingen2D
from .vhr10 import VHR10
from .xview import XView2
from .zuericrop import ZueriCrop

Expand Down
8 changes: 2 additions & 6 deletions torchgeo/datasets/nwpu.py → torchgeo/datasets/vhr10.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ def convert_coco_poly_to_mask(
Returns:
Tensor: Mask tensor
"""
try:
from pycocotools import mask as coco_mask # noqa: F401
except ImportError:
raise ImportError(
"pycocotools is not installed and is required to use this dataset"
)
from pycocotools import mask as coco_mask # noqa: F401

masks = []
for polygons in segmentations:
rles = coco_mask.frPyObjects(polygons, height, width)
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
"landcoverai": (SemanticSegmentationTask, LandCoverAIDataModule),
"naipchesapeake": (SemanticSegmentationTask, NAIPChesapeakeDataModule),
"nasa_marine_debris": (ObjectDetectionTask, NASAMarineDebrisDataModule),
"nwpu_vhr10": (ObjectDetectionTask, VHR10DataModule),
"oscd": (SemanticSegmentationTask, OSCDDataModule),
"resisc45": (ClassificationTask, RESISC45DataModule),
"sen12ms": (SemanticSegmentationTask, SEN12MSDataModule),
"so2sat": (ClassificationTask, So2SatDataModule),
"ucmerced": (ClassificationTask, UCMercedDataModule),
"vhr10": (ObjectDetectionTask, VHR10DataModule),
}


Expand Down

0 comments on commit 8acd267

Please sign in to comment.