-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
565 feature geo inference integration #566
Merged
valhassan
merged 52 commits into
NRCan:develop
from
valhassan:565-feature-geo-inference-integration
Jul 15, 2024
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
7bef6c8
Update environment.yml with new dependencies
cae1bf7
Refactor code to support geo-inference package
22ecdaa
Update model_path in inference config files
24dd60b
Refactor batch size calculation and add stride size in geo_inference
71b60c2
Add batch_size parameter to inference configuration files
138f76e
Update geo_inference function call in inference_segmentation.py
fd5dfe8
Remove unused function and add logging parameters
e7d610e
Add inference segmentation test files
ce92822
Merge branch 'develop' of https://github.com/NRCan/geo-deep-learning …
5b0df44
Add support for handling logits and multiple classes in ScriptModel
7bd07e8
Add logging statement and update model initialization parameters
40a1026
Add support for saving scripted model
9df072e
Merge branch 'geo-inference' of https://github.com/NRCan/geo-deep-lea…
9d48ad1
Update script_model flag to True
81451bd
Fix wildcard in inference_segmentation.py
f0d2d03
Fix condition for checking if GPUs are requested
b6570c2
Add training.num_gpus=0 to hydra overrides
078459c
Update normalization parameters in basic_augmentation_segmentation.yaml
41ba98b
Update output path in evaluate_segmentation.py
8318786
Update Python and PyTorch versions in environment.yml
c645f63
Remove mkl dependency
f1cfd45
Update dependencies in environment.yml
8e12e4a
Update dependencies in environment.yml
99ddc42
Update inference config files with new post-processing option
a7e161e
Fix mask_to_vec parameter in inference_segmentation.py
f3266dd
Update environment.yml file with new name for environment
cfc293e
Add geo-inference package and update dependencies
d06f792
Merge branch 'develop' of https://github.com/valhassan/geo-deep-learn…
0780249
Update geo-inference dependency installation option
2079e2f
Update geo-inference dependency to version 2.0.5 with torch 1.12.0
973a2bd
Update dependencies in environment.yml
1d34680
Fix import statement for rank_zero_only in utils.py
1f08e95
Remove unnecessary channels from environment.yml
48820a8
Merge branch 'develop' of https://github.com/valhassan/geo-deep-learn…
6de73e2
Add geopandas dependency
93d7fea
Update dependencies in environment.yml
c190509
Add numpy import and convert raster_np to float32
be749a1
Add import statement for DataSourceError in test_aoi.py
f26337d
Refactor dataset initialization and add spatial reference
8a1adc1
Remove unused utils.inference.py file and test_inference.py
4a12cc6
Update visualization.py with matplotlib import changes
25f0e1d
Add debug print statements in inference_segmentation.py
a5e36ce
Add debug print statements for image names
8ba8838
Update geo-inference version to 2.0.7
valhassan 0e5133e
Refactor inference_segmentation.py to remove unnecessary print statem…
valhassan 2ace890
Update GitHub Actions CI workflow
c0a09c8
Update conda environment activation command
4bf67c3
Update GitHub Actions workflow to use Conda environment
39ac351
Update GitHub Actions workflow to run pytest tests
afb6dae
Merge branch 'develop' of https://github.com/valhassan/geo-deep-learn…
cfbde31
Update normalization parameters in basic_augmentation_segmentation.yaml
0d71ef7
Remove print statements in evaluate_segmentation.py
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,22 @@ | ||
name: GitHub Actions Unit Tests | ||
name: tests | ||
on: [push, pull_request] | ||
jobs: | ||
clean-and-deploy-env: | ||
runs-on: ubuntu-latest | ||
env: | ||
LD_LIBRARY_PATH: "/opt/conda/lib" | ||
run-tests: | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
- name: checkout repository | ||
uses: actions/checkout@v4.1.2 | ||
|
||
- name: create environment | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
|
||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
android: true | ||
dotnet: false | ||
haskell: false | ||
large-packages: false | ||
docker-images: false | ||
swap-storage: false | ||
|
||
- name: Update the environment | ||
mamba-version: "*" | ||
activate-environment: geo_deep_env | ||
environment-file: environment.yml | ||
|
||
- name: test with pytest | ||
run: | | ||
sudo apt-get update \ | ||
&& sudo apt-get install -y --no-install-recommends git wget unzip bzip2 build-essential | ||
|
||
- name: Install Mamba | ||
run: | | ||
sudo wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh -O /tmp/mamba.sh && \ | ||
/bin/bash /tmp/mamba.sh -b -p /opt/conda && \ | ||
sudo rm -rf /tmp/* && \ | ||
sudo apt-get clean && \ | ||
sudo rm -rf /var/lib/apt/lists/* | ||
|
||
- name: Set system variables | ||
run: | | ||
echo '/opt/conda' >> $GITHUB_PATH | ||
|
||
- name: Check if Custom Paths are Added | ||
run: | | ||
echo "$PATH" | ||
echo "$LD_LIBRARY_PATH" | ||
|
||
- name: Install pyenv | ||
run: | | ||
pip install pipenv | ||
pip install pytest | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
/opt/conda/bin/mamba env create -f environment.yml | ||
echo '/opt/conda/envs/geo_deep_env/bin' >> $GITHUB_PATH | ||
|
||
- name: Test with pytest | ||
run: | | ||
pipenv run pytest tests/ | ||
pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
name: geo_deep_env | ||
channels: | ||
- pytorch | ||
- conda-forge | ||
dependencies: | ||
- coverage>=6.3.1 | ||
- docker-py>=4.4.4 | ||
- geopandas>=0.10.2 | ||
- hydra-core>=1.2.0 | ||
- python==3.11.5 | ||
- pip | ||
- pynvml>=11.0 | ||
- gdal | ||
- pystac>=0.3.0 | ||
- pytest>=7.1 | ||
- python>=3.10 | ||
- pytorch==1.12 | ||
- mkl<=2024.0 | ||
- rich>=11.1 | ||
- ruamel_yaml>=0.15 | ||
- scikit-image>=0.18 | ||
- torchgeo>=0.3 | ||
- torchvision>=0.12 | ||
- pip: | ||
- geo-inference>=2.0.7 | ||
- hydra-colorlog>=1.1.0 | ||
- hydra-optuna-sweeper>=1.1.0 | ||
- ttach>=0.0.3 | ||
- mlflow>=1.2 # causes env solving to hang if not with pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍