Skip to content

Commit

Permalink
Merge branch 'main' into bigearthnnetv1brokenlink
Browse files Browse the repository at this point in the history
  • Loading branch information
burakekim authored Jul 17, 2024
2 parents 37d15e8 + 7de473d commit 852d03c
Show file tree
Hide file tree
Showing 204 changed files with 761 additions and 2,019 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ updates:
- "torch"
- "torchvision"
ignore:
# lightning 2.3+ contains known bugs related to YAML parsing
# https://github.com/Lightning-AI/pytorch-lightning/issues/19977
- dependency-name: "lightning"
version: ">=2.3"
# setuptools releases new versions almost daily
- dependency-name: "setuptools"
update-types: ["version-update:semver-patch"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Add label
uses: actions/[email protected]
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand All @@ -40,9 +40,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand All @@ -39,9 +39,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand All @@ -66,9 +66,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up nodejs
uses: actions/[email protected].2
uses: actions/[email protected].3
with:
node-version: "20"
cache: "npm"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
pytest --cov=torchgeo --cov-report=xml --durations=10
python3 -m torchgeo --help
- name: Report coverage
uses: codecov/codecov-action@v4.4.1
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
minimum:
Expand All @@ -67,9 +67,9 @@ jobs:
MPLBACKEND: Agg
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.10"
- name: Cache dependencies
Expand All @@ -96,7 +96,7 @@ jobs:
pytest --cov=torchgeo --cov-report=xml --durations=10
python3 -m torchgeo --help
- name: Report coverage
uses: codecov/codecov-action@v4.4.1
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
datasets:
Expand All @@ -106,9 +106,9 @@ jobs:
MPLBACKEND: Agg
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand All @@ -129,7 +129,7 @@ jobs:
pytest --cov=torchgeo --cov-report=xml --durations=10
python3 -m torchgeo --help
- name: Report coverage
uses: codecov/codecov-action@v4.4.1
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tutorials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/[email protected].6
uses: actions/[email protected].7
- name: Set up python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.12"
- name: Cache dependencies
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
- lightning>=2.0.9
- matplotlib>=3.8.1
- numpy>=1.22
- pillow>=10.3.0
- pillow>=10.4.0
- pytest>=6.1.2
- pyvista>=0.34.2
- scikit-image>=0.22.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ torchgeo fit --config config.yaml
# Validate-only
torchgeo validate --config config.yaml
# Calculate and report test accuracy
torchgeo test --config config.yaml ckpt_path=...
torchgeo test --config config.yaml --ckpt_path=...
```

It can also be imported and used in a Python script if you need to extend it to add new features:
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 @@ -27,7 +27,7 @@ Dataset,Task,Source,License,# Samples,# Classes,Size (px),Resolution (m),Bands
`NASA Marine Debris`_,OD,PlanetScope,"Apache-2.0",707,1,256x256,3,RGB
`OSCD`_,CD,Sentinel-2,"CC-BY-4.0",24,2,"40--1,180",60,MSI
`PASTIS`_,I,Sentinel-1/2,"CC-BY-4.0","2,433",19,128x128xT,10,MSI
`PatternNet`_,C,Google Earth,-,"30,400",38,256x256,0.06--5,RGB
`PatternNet`_,C,Google Earth,"CC-BY-4.0","30,400",38,256x256,0.06--5,RGB
`Potsdam`_,S,Aerial,-,38,6,"6,000x6,000",0.05,MSI
`QuakeSet`_,"C, R",Sentinel-1,"OpenRAIL","3,327",2,512x512,10,SAR
`ReforesTree`_,"OD, R",Aerial,"CC-BY-4.0",100,6,"4,000x4,000",0.02,RGB
Expand Down
16 changes: 0 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,6 @@
:class: colabbadge
:alt: Open in Colab
:target: {{ host }}/github/{{ repo }}/blob/{{ branch }}/{{ urlpath }}
{% set host = "https://pccompute.westeurope.cloudapp.azure.com" %}
{% set host = host ~ "/compute/hub/user-redirect/git-pull" %}
{% set repo = "https%3A%2F%2Fgithub.com%2Fmicrosoft%2Ftorchgeo" %}
{% set urlpath = "tree%2Ftorchgeo%2Fdocs%2F" %}
{% set urlpath = urlpath ~ env.docname | replace("/", "%2F") ~ ".ipynb" %}
{% if "dev" in env.config.release %}
{% set branch = "main" %}
{% else %}
{% set branch = "releases%2Fv" ~ env.config.version %}
{% endif %}
.. image:: https://img.shields.io/badge/-Open%20on%20Planetary%20Computer-blue
:class: colabbadge
:alt: Open on Planetary Computer
:target: {{ host }}?repo={{ repo }}&urlpath={{ urlpath }}&branch={{ branch }}
"""

# Disables requirejs in nbsphinx to enable compatibility with the pytorch_sphinx_theme
Expand Down
8 changes: 2 additions & 6 deletions experiments/ssl4eo/plot_example_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@
data = sample[key]
if key == 'image':
data = data[[2, 1, 0]].permute(1, 2, 0).numpy().astype('uint8')
Image.fromarray(data, 'RGB').save( # type: ignore[no-untyped-call]
f'{path}/{key}.png'
)
Image.fromarray(data, 'RGB').save(f'{path}/{key}.png')
else:
data = data * 255 / 4
data = data.numpy().astype('uint8').squeeze()
Image.fromarray(data, 'L').save( # type: ignore[no-untyped-call]
f'{path}/{key}.png'
)
Image.fromarray(data, 'L').save(f'{path}/{key}.png')
i += 1
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ dependencies = [
"einops>=0.3",
# fiona 1.8.21+ required for Python 3.10 wheels
"fiona>=1.8.21",
# kornia 0.7.2+ required for dict support in AugmentationSequential
"kornia>=0.7.2",
# kornia 0.7.3+ required for instance segmentation support in AugmentationSequential
"kornia>=0.7.3",
# lightly 1.4.4+ required for MoCo v3 support
# lightly 1.4.26 is incompatible with the version of timm required by smp
# https://github.com/microsoft/torchgeo/issues/1824
"lightly>=1.4.4,!=1.4.26",
# lightning 2+ required for LightningCLI args + sys.argv support
"lightning[pytorch-extra]>=2",
# lightning 2.3+ contains known bugs related to YAML parsing
# https://github.com/Lightning-AI/pytorch-lightning/issues/19977
"lightning[pytorch-extra]>=2,<2.3",
# matplotlib 3.5+ required for Python 3.10 wheels
"matplotlib>=3.5",
# numpy 1.21.2+ required by Python 3.10 wheels
Expand Down Expand Up @@ -266,7 +268,7 @@ quote-style = "single"
skip-magic-trailing-comma = true

[tool.ruff.lint]
extend-select = ["D", "I", "UP"]
extend-select = ["D", "I", "NPY201", "UP"]

[tool.ruff.lint.per-file-ignores]
"docs/**" = ["D"]
Expand Down
12 changes: 6 additions & 6 deletions requirements/datasets.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# datasets
h5py==3.11.0
laspy==2.5.3
opencv-python==4.9.0.80
pycocotools==2.0.7
pyvista==0.43.8
laspy==2.5.4
opencv-python==4.10.0.84
pycocotools==2.0.8
pyvista==0.44.0
radiant-mlhub==0.4.1
rarfile==4.2
scikit-image==0.23.2
scipy==1.13.1
scikit-image==0.24.0
scipy==1.14.0
zipfile-deflate64==0.2.0
2 changes: 1 addition & 1 deletion requirements/min-reqs.old
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ setuptools==61.0.0
# install
einops==0.3.0
fiona==1.8.21
kornia==0.7.2
kornia==0.7.3
lightly==1.4.4
lightning[pytorch-extra]==2.0.0
matplotlib==3.5.0
Expand Down
12 changes: 9 additions & 3 deletions requirements/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "torchgeo",
"private": "true",
"dependencies": {
"prettier": ">=3.0.0"
"prettier": ">=3.3.3"
}
}
16 changes: 8 additions & 8 deletions requirements/required.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# setup
setuptools==70.0.0
setuptools==70.3.0

# install
einops==0.8.0
fiona==1.9.6
kornia==0.7.2
lightly==1.5.4
kornia==0.7.3
lightly==1.5.9
lightning[pytorch-extra]==2.2.5
matplotlib==3.9.0
numpy==1.26.4
pandas==2.2.2
pillow==10.3.0
pillow==10.4.0
pyproj==3.6.1
rasterio==1.3.10
rtree==1.2.0
rtree==1.3.0
segmentation-models-pytorch==0.3.3
shapely==2.0.4
shapely==2.0.5
timm==0.9.2
torch==2.3.0
torch==2.3.1
torchmetrics==1.4.0.post0
torchvision==0.18.0
torchvision==0.18.1
4 changes: 2 additions & 2 deletions requirements/style.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# style
mypy==1.10.0
ruff==0.4.6
mypy==1.10.1
ruff==0.5.2
4 changes: 2 additions & 2 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tests
nbmake==1.5.3
pytest==8.2.1
nbmake==1.5.4
pytest==8.2.2
pytest-cov==5.0.0
2 changes: 1 addition & 1 deletion tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ with rio.open(os.path.join(ROOT, FILENAME), "r") as src:
dtype = src.profile["dtype"]
Z = np.random.randint(np.iinfo(dtype).max, size=(SIZE, SIZE), dtype=dtype)
with rio.open(FILENAME, "w", **src.profile) as dst:
for i in dst.profile.indexes:
for i in dst.indexes:
dst.write(Z, i)
```

Expand Down
5 changes: 5 additions & 0 deletions tests/data/cv4a_kenya_crop_type/FieldIds.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
train,test
1,2
3,4
5
6
Loading

0 comments on commit 852d03c

Please sign in to comment.