-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from plantnet/main
Re-sync
- Loading branch information
Showing
38 changed files
with
519 additions
and
147 deletions.
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
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
8 changes: 8 additions & 0 deletions
8
examples/ecologists/micro_geolifeclef2022/cnn_on_rgb_nir_patches.py
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,3 +1,11 @@ | ||
"""Main script to run training or inference on microlifeclef2022 dataset. | ||
Uses RGB and Near infra-red pre-extracted patches from the dataset. | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import os | ||
|
8 changes: 8 additions & 0 deletions
8
examples/ecologists/micro_geolifeclef2022/cnn_on_rgb_patches.py
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,3 +1,11 @@ | ||
"""Main script to run training or inference on microlifeclef2022 dataset. | ||
Uses RGB pre-extracted patches from the dataset. | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import os | ||
|
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 |
---|---|---|
|
@@ -3,9 +3,10 @@ | |
These transform classes can be called during training loops to perform | ||
data augmentation. | ||
Author: Titouan Lorieul <titouan.lorieul@inria.fr> | ||
Author: Titouan Lorieul <titouan.lorieul@gmail.com> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
import numpy as np | ||
import torch | ||
from torchvision import transforms | ||
|
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 |
---|---|---|
|
@@ -3,8 +3,9 @@ | |
This script runs the RasterSentinel2 dataset class by default. | ||
Author: Theo Larcher <[email protected]> | ||
Titouan Lorieul <titouan.lorieul@inria.fr> | ||
Titouan Lorieul <titouan.lorieul@gmail.com> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import os | ||
|
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,5 +1,13 @@ | ||
import numpy as np | ||
"""Collection of custom PyTorch friendly transform classes. | ||
These transform classes can be called during training loops to perform | ||
data augmentation. | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
import numpy as np | ||
import torch | ||
from torchvision import transforms | ||
|
||
|
11 changes: 8 additions & 3 deletions
11
examples/inference/micro_geolifeclef2022/cnn_on_rgb_nir_patches.py
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,9 +1,14 @@ | ||
from __future__ import annotations | ||
"""Main script to run inference on microlifeclef2022 dataset. | ||
Uses RGB and Near infra-red pre-extracted patches from the dataset. | ||
import os | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import hydra | ||
import numpy as np | ||
import pytorch_lightning as pl | ||
import torch | ||
from omegaconf import DictConfig | ||
|
10 changes: 8 additions & 2 deletions
10
examples/inference/micro_geolifeclef2022/cnn_on_rgb_patches.py
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,6 +1,12 @@ | ||
from __future__ import annotations | ||
"""Main script to run inference on microlifeclef2022 dataset. | ||
Uses RGB pre-extracted patches from the dataset. | ||
import os | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import hydra | ||
import pytorch_lightning as pl | ||
|
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 |
---|---|---|
|
@@ -3,9 +3,10 @@ | |
These transform classes can be called during training loops to perform | ||
data augmentation. | ||
Author: Titouan Lorieul <titouan.lorieul@inria.fr> | ||
Author: Titouan Lorieul <titouan.lorieul@gmail.com> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
import numpy as np | ||
import torch | ||
from torchvision import transforms | ||
|
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 |
---|---|---|
|
@@ -3,11 +3,10 @@ | |
This script runs the RasterSentinel2 dataset class by default. | ||
Author: Theo Larcher <[email protected]> | ||
Titouan Lorieul <titouan.lorieul@inria.fr> | ||
Titouan Lorieul <titouan.lorieul@gmail.com> | ||
""" | ||
from __future__ import annotations | ||
|
||
import os | ||
from __future__ import annotations | ||
|
||
import hydra | ||
import pytorch_lightning as pl | ||
|
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,5 +1,13 @@ | ||
import numpy as np | ||
"""Collection of custom PyTorch friendly transform classes. | ||
These transform classes can be called during training loops to perform | ||
data augmentation. | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
import numpy as np | ||
import torch | ||
from torchvision import transforms | ||
|
||
|
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,8 +1,14 @@ | ||
import os | ||
"""Main script to run training on microlifeclef2022 dataset. | ||
Uses RGB pre-extracted patches from the dataset. | ||
This script was created for Kaggle participants of the GeoLifeCLEF 2022 | ||
challenge. | ||
Author: Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
import hydra | ||
import pytorch_lightning as pl | ||
import torchmetrics.functional as Fmetrics | ||
import pytorch_lightning as p | ||
from omegaconf import DictConfig | ||
from pytorch_lightning.callbacks import ModelCheckpoint | ||
from torchvision import transforms | ||
|
10 changes: 9 additions & 1 deletion
10
examples/kaggle/geolifeclef2022/cnn_on_rgb_temperature_patches.py
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,4 +1,12 @@ | ||
import os | ||
"""Main script to run training on microlifeclef2022 dataset. | ||
Uses RGB pre-extracted patches and temperature rasters from the dataset. | ||
This script was created for Kaggle participants of the GeoLifeCLEF 2022 | ||
challenge. | ||
Author: Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
import hydra | ||
|
10 changes: 9 additions & 1 deletion
10
examples/kaggle/geolifeclef2022/cnn_on_temperature_patches.py
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,4 +1,12 @@ | ||
import os | ||
"""Main script to run training on microlifeclef2022 dataset. | ||
Uses temperature rasters from the dataset. | ||
This script was created for Kaggle participants of the GeoLifeCLEF 2022 | ||
challenge. | ||
Author: Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
import hydra | ||
|
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,3 +1,12 @@ | ||
"""Collection of custom PyTorch friendly transform classes. | ||
These transform classes can be called during training loops to perform | ||
data augmentation. | ||
Author: Titouan Lorieul <[email protected]> | ||
Theo Larcher <[email protected]> | ||
""" | ||
|
||
import numpy as np | ||
import torch | ||
from torchvision import transforms | ||
|
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 |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
This script runs the RasterSentinel2 dataset class by default. | ||
Author: Theo Larcher <[email protected]> | ||
Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import hydra | ||
|
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,9 +1,15 @@ | ||
"""This module checks the installation of PyTorch and GPU libraries. | ||
Author: Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
import os | ||
|
||
import torch | ||
|
||
|
||
def print_cuda_info(): | ||
"""Print information about the CUDA/PyTorch installation.""" | ||
print(f"Using PyTorch version {torch.__version__}") | ||
print(f"CUDA available: {torch.cuda.is_available()} (version: {torch.version.cuda})") | ||
print(f"cuDNN available: {torch.backends.cudnn.enabled} (version: {torch.backends.cudnn.version()})") | ||
|
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,8 +1,7 @@ | ||
"""This module provides a base class for data modules. | ||
Author: Theo Larcher <[email protected]> | ||
Titouan Lorieul <[email protected]> | ||
Titouan Lorieul <[email protected]> | ||
""" | ||
|
||
from __future__ import annotations | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
This module has since been updated for GeoLifeCLEF2023 | ||
Author: Benjamin Deneu <[email protected]> | ||
Titouan Lorieul <titouan.lorieul@inria.fr> | ||
Titouan Lorieul <titouan.lorieul@gmail.com> | ||
License: GPLv3 | ||
Python version: 3.8 | ||
|
@@ -347,9 +347,9 @@ def download(self): | |
return | ||
|
||
try: | ||
import kaggle | ||
import kaggle # pylint: disable=C0415,W0611 # noqa: F401 | ||
except OSError as error: | ||
raise OSError("Have you properly set up your Kaggle API token ? For more information, please refer to section 'Authentication' of the kaggle documentation : https://www.kaggle.com/docs/api"+msg) from error | ||
raise OSError("Have you properly set up your Kaggle API token ? For more information, please refer to section 'Authentication' of the kaggle documentation : https://www.kaggle.com/docs/api") from error | ||
|
||
answer = input("You are about to download the GeoLifeClef2022 dataset which weighs ~62 GB. Do you want to continue ? [y/n]") | ||
if answer.lower() in ["y", "yes"]: | ||
|
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.