зеркало из https://github.com/microsoft/torchgeo.git
0.5.0 release (#1604)
* 0.5.0 release * Fix caching hash * Warnings not raised because not final layer * Skip tests that require optional deps * Isort fixes * Fix? ChesapeakeCVPR tests * Hack to avoid GeoDataset bug
This commit is contained in:
Родитель
18139b440b
Коммит
68f37da155
|
@ -22,7 +22,7 @@ jobs:
|
|||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
|
||||
- name: Install pip dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pip install .[tests]
|
||||
|
@ -48,7 +48,7 @@ jobs:
|
|||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
|
||||
- name: Install pip dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pip install .[datasets,tests]
|
||||
|
@ -74,7 +74,7 @@ jobs:
|
|||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
|
||||
- name: Install pip dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pip install .[docs,tests] planetary_computer pystac
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
id: cache
|
||||
with:
|
||||
path: ${{ env.pythonLocation }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
|
||||
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
|
||||
- name: Install pip dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: pip install .[docs,tests] planetary_computer pystac
|
||||
|
|
|
@ -189,6 +189,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"chesapeake_root = os.path.join(tempfile.gettempdir(), \"chesapeake\")\n",
|
||||
"os.makedirs(chesapeake_root, exist_ok=True)\n",
|
||||
"chesapeake = ChesapeakeDE(chesapeake_root, crs=naip.crs, res=naip.res, download=True)"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -81,6 +81,7 @@ class TestADVANCE:
|
|||
dataset[0]
|
||||
|
||||
def test_plot(self, dataset: ADVANCE) -> None:
|
||||
pytest.importorskip("scipy", minversion="1.6.2")
|
||||
x = dataset[0].copy()
|
||||
dataset.plot(x, suptitle="Test")
|
||||
plt.close()
|
||||
|
|
|
@ -18,6 +18,8 @@ from pytest import MonkeyPatch
|
|||
import torchgeo.datasets.utils
|
||||
from torchgeo.datasets import SKIPPD
|
||||
|
||||
pytest.importorskip("h5py", minversion="3")
|
||||
|
||||
|
||||
def download_url(url: str, root: str, *args: str, **kwargs: str) -> None:
|
||||
shutil.copy(url, root)
|
||||
|
|
|
@ -17,6 +17,9 @@ from torchgeo.datasets import NASAMarineDebris
|
|||
from torchgeo.main import main
|
||||
from torchgeo.trainers import ObjectDetectionTask
|
||||
|
||||
# MAP metric requires pycocotools to be installed
|
||||
pytest.importorskip("pycocotools")
|
||||
|
||||
|
||||
class PredictObjectDetectionDataModule(NASAMarineDebrisDataModule):
|
||||
def setup(self, stage: str) -> None:
|
||||
|
|
|
@ -128,20 +128,16 @@ class TestMoCoTask:
|
|||
|
||||
@pytest.mark.slow
|
||||
def test_weight_enum_download(self, weights: WeightsEnum) -> None:
|
||||
match = "num classes .* != num classes in pretrained model"
|
||||
with pytest.warns(UserWarning, match=match):
|
||||
MoCoTask(
|
||||
model=weights.meta["model"],
|
||||
weights=weights,
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
MoCoTask(
|
||||
model=weights.meta["model"],
|
||||
weights=weights,
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_weight_str_download(self, weights: WeightsEnum) -> None:
|
||||
match = "num classes .* != num classes in pretrained model"
|
||||
with pytest.warns(UserWarning, match=match):
|
||||
MoCoTask(
|
||||
model=weights.meta["model"],
|
||||
weights=str(weights),
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
MoCoTask(
|
||||
model=weights.meta["model"],
|
||||
weights=str(weights),
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
|
|
|
@ -66,6 +66,9 @@ class TestRegressionTask:
|
|||
def test_trainer(
|
||||
self, monkeypatch: MonkeyPatch, name: str, fast_dev_run: bool
|
||||
) -> None:
|
||||
if name == "skippd":
|
||||
pytest.importorskip("h5py", minversion="3")
|
||||
|
||||
config = os.path.join("tests", "conf", name + ".yaml")
|
||||
|
||||
monkeypatch.setattr(timm, "create_model", self.create_model)
|
||||
|
|
|
@ -126,20 +126,16 @@ class TestSimCLRTask:
|
|||
|
||||
@pytest.mark.slow
|
||||
def test_weight_enum_download(self, weights: WeightsEnum) -> None:
|
||||
match = "num classes .* != num classes in pretrained model"
|
||||
with pytest.warns(UserWarning, match=match):
|
||||
SimCLRTask(
|
||||
model=weights.meta["model"],
|
||||
weights=weights,
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
SimCLRTask(
|
||||
model=weights.meta["model"],
|
||||
weights=weights,
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_weight_str_download(self, weights: WeightsEnum) -> None:
|
||||
match = "num classes .* != num classes in pretrained model"
|
||||
with pytest.warns(UserWarning, match=match):
|
||||
SimCLRTask(
|
||||
model=weights.meta["model"],
|
||||
weights=str(weights),
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
SimCLRTask(
|
||||
model=weights.meta["model"],
|
||||
weights=str(weights),
|
||||
in_channels=weights.meta["in_chans"],
|
||||
)
|
||||
|
|
|
@ -11,4 +11,4 @@ common image transformations for geospatial data.
|
|||
"""
|
||||
|
||||
__author__ = "Adam J. Stewart"
|
||||
__version__ = "0.5.0.dev0"
|
||||
__version__ = "0.5.0"
|
||||
|
|
|
@ -93,7 +93,7 @@ class ChesapeakeCVPRDataModule(GeoDataModule):
|
|||
"""
|
||||
# This is a rough estimate of how large of a patch we will need to sample in
|
||||
# EPSG:3857 in order to guarantee a large enough patch in the local CRS.
|
||||
self.original_patch_size = patch_size * 2
|
||||
self.original_patch_size = patch_size * 3
|
||||
kwargs["transforms"] = _Transform(K.CenterCrop(patch_size))
|
||||
|
||||
super().__init__(
|
||||
|
|
Загрузка…
Ссылка в новой задаче