Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cookie-kyu authored Feb 13, 2024
2 parents 419cb64 + f3270ca commit 524ada2
Show file tree
Hide file tree
Showing 140 changed files with 600 additions and 201 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/coverage.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -93,7 +93,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -118,7 +118,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -143,7 +143,7 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
Expand Down
26 changes: 5 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Clone repo
uses: actions/[email protected]
Expand All @@ -31,7 +31,7 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/required.txt') }}-${{ hashFiles('requirements/datasets.txt') }}-${{ hashFiles('requirements/tests.txt') }}
if: ${{ ! (runner.os == 'macOS' && matrix.python-version == '3.11') }}
if: ${{ ! (runner.os == 'macOS' && (matrix.python-version == '3.11' || matrix.python-version == '3.12')) }}
- name: Setup headless display for pyvista
uses: pyvista/setup-headless-display-action@v2
- name: Install apt dependencies (Linux)
Expand All @@ -56,11 +56,10 @@ jobs:
run: |
pytest --cov=torchgeo --cov-report=xml --durations=10
python3 -m torchgeo --help
- name: Upload coverage artifact
uses: actions/[email protected]
- name: Report coverage
uses: codecov/[email protected]
with:
name: coverage_${{ matrix.os }}_py-${{ matrix.python-version }}
path: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
minimum:
name: minimum
runs-on: ubuntu-latest
Expand Down Expand Up @@ -96,25 +95,10 @@ jobs:
run: |
pytest --cov=torchgeo --cov-report=xml --durations=10
python3 -m torchgeo --help
- name: Upload coverage artifact
uses: actions/[email protected]
with:
name: coverage_minimum
path: coverage.xml
codecov:
name: codecov
runs-on: ubuntu-latest
needs: [latest, minimum]
steps:
- name: Clone repo
uses: actions/[email protected]
- name: Download coverage artifacts
uses: actions/[email protected]
- name: Report coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
6 changes: 3 additions & 3 deletions .github/workflows/tutorials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.11'
python-version: '3.12'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-tutorials
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/required.txt') }}-${{ hashFiles('requirements/docs.txt') }}-${{ hashFiles('requirements/tests.txt') }}-tutorials
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install .[docs,tests] planetary_computer pystac
pip install -r requirements/required.txt -r requirements/docs.txt -r requirements/tests.txt planetary_computer pystac
pip cache purge
- name: List pip dependencies
run: pip list
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

# Configuration of the Python environment to be used
python:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ from torchgeo.models import ResNet18_Weights

weights = ResNet18_Weights.SENTINEL2_ALL_MOCO
model = timm.create_model("resnet18", in_chans=weights.meta["in_chans"], num_classes=10)
model = model.load_state_dict(weights.get_state_dict(progress=True), strict=False)
model.load_state_dict(weights.get_state_dict(progress=True), strict=False)
```

These weights can also directly be used in TorchGeo Lightning modules that are shown in the following section via the `weights` argument. For a notebook example, see this [tutorial](https://torchgeo.readthedocs.io/en/stable/tutorials/pretrained_weights.html).
Expand Down
5 changes: 5 additions & 0 deletions docs/api/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Aboveground Woody Biomass

.. autoclass:: AbovegroundLiveWoodyBiomassDensity

AgriFieldNet
^^^^^^^^^^^^

.. autoclass:: AgriFieldNet

Airphen
^^^^^^^

Expand Down
1 change: 1 addition & 0 deletions docs/api/geo_datasets.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Dataset,Type,Source,License,Size (px),Resolution (m)
`Aboveground Woody Biomass`_,Masks,"Landsat, LiDAR","CC-BY-4.0","40,000x40,000",30
`AgriFieldNet`_,"Imagery, Masks",Sentinel-2,"CC-BY-4.0","256x256",10
`Airphen`_,Imagery,Airphen,-,"1,280x960",0.047--0.09
`Aster Global DEM`_,Masks,Aster,"public domain","3,601x3,601",30
`Canadian Building Footprints`_,Geometries,Bing Imagery,"ODbL-1.0",-,-
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/pretrained_weights.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"source": [
"in_chans = weights.meta[\"in_chans\"]\n",
"model = timm.create_model(\"resnet18\", in_chans=in_chans, num_classes=10)\n",
"model = model.load_state_dict(weights.get_state_dict(progress=True), strict=False)"
"model.load_state_dict(weights.get_state_dict(progress=True), strict=False)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
"id": "w4ZbjxPyHoiB"
},
"source": [
"It's even possible to chain indices along with augmentations from kornia for a single callable during training."
"It's even possible to chain indices along with augmentations from Kornia for a single callable during training."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion experiments/torchgeo/run_resisc45_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
for model, lr, loss, weights in itertools.product(
model_options, lr_options, loss_options, weight_options
):
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_','-')}"
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_', '-')}"

output_dir = os.path.join("output", "resisc45_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand Down
2 changes: 1 addition & 1 deletion experiments/torchgeo/run_so2sat_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
for model, lr, loss, weights in itertools.product(
model_options, lr_options, loss_options, weight_options
):
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_','-')}"
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_', '-')}"

output_dir = os.path.join("output", "so2sat_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand Down
2 changes: 1 addition & 1 deletion experiments/torchgeo/run_so2sat_seed_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
for model, lr, loss, weights, seed in itertools.product(
model_options, lr_options, loss_options, weight_options, seeds
):
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_','-')}_{seed}"
experiment_name = f"{model}_{lr}_{loss}_{weights.replace('_', '-')}_{seed}"

output_dir = os.path.join("output", "so2sat_seed_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: GIS",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements/datasets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ h5py==3.10.0
laspy==2.5.3
opencv-python==4.9.0.80
pycocotools==2.0.7
pyvista==0.43.2
pyvista==0.43.3
radiant-mlhub==0.4.1
rarfile==4.1
scikit-image==0.22.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docs
ipywidgets==8.1.1
ipywidgets==8.1.2
nbsphinx==0.9.3
sphinx==5.3.0
4 changes: 2 additions & 2 deletions requirements/required.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ einops==0.7.0
fiona==1.9.5
kornia==0.7.1
lightly==1.4.25
lightning[pytorch-extra]==2.1.4
lightning[pytorch-extra]==2.2.0
matplotlib==3.8.2
numpy==1.26.3
numpy==1.26.4
pandas==2.2.0
pillow==10.2.0
pyproj==3.6.1
Expand Down
Loading

0 comments on commit 524ada2

Please sign in to comment.