From ae88ab51054b14a5adbac126bee82e95608ed694 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:05:06 +0200 Subject: [PATCH 01/11] DOC: remove mention to deprecated "usenodata" parameter --- app/otbPatchesExtraction.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/otbPatchesExtraction.cxx b/app/otbPatchesExtraction.cxx index b00c3a17..33eb603c 100644 --- a/app/otbPatchesExtraction.cxx +++ b/app/otbPatchesExtraction.cxx @@ -91,7 +91,7 @@ public: ss_key_dims_y << ss_group_key.str() << ".patchsizey"; ss_desc_dims_y << "Y patch size for image " << inputNumber; ss_key_nodata << ss_group_key.str() << ".nodata"; - ss_desc_nodata << "No-data value for image " << inputNumber << "(used only if \"usenodata\" is on)"; + ss_desc_nodata << "No-data value for image " << inputNumber; // Populate group AddParameter(ParameterType_Group, ss_group_key.str(), ss_desc_group.str()); -- GitLab From 31b5f3053a3d0db43e12c493cbe4c5e9c4717dd2 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:05:22 +0200 Subject: [PATCH 02/11] DOC: update applications descriptions --- doc/APPLICATIONS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/APPLICATIONS.md b/doc/APPLICATIONS.md index a0bd988f..2ca5fd1f 100644 --- a/doc/APPLICATIONS.md +++ b/doc/APPLICATIONS.md @@ -30,9 +30,8 @@ MISSING -source1.il <string list> Input image(s) 1 (mandatory) MISSING -source1.out <string> [pixel] Output patches for image 1 [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is float) (mandatory) MISSING -source1.patchsizex <int32> X patch size for image 1 (mandatory) MISSING -source1.patchsizey <int32> Y patch size for image 1 (mandatory) - -source1.nodata <float> No-data value for image 1(used only if "usenodata" is on) (mandatory, default value is 0) + -source1.nodata <float> No-data value for image 1 MISSING -vec <string> Positions of the samples (must be in the same projection as input image) (mandatory) - -usenodata <boolean> Reject samples that have no-data value (optional, off by default, default value is false) -outlabels <string> [pixel] output labels [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is uint8) (optional, off by default) MISSING -field <string> field of class in the vector data (mandatory) -progress <boolean> Report progress -- GitLab From 37c5fc5f35478ea986ffd3e0e78f7794f4c29515 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:05:33 +0200 Subject: [PATCH 03/11] DOC: update release notes --- RELEASE_NOTES.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 76403305..f539756e 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,8 @@ +Version 3.0.0 (5 apr 2022) +---------------------------------------------------------------- +* Add the "split" strategy in the `PatchesSelection` application. Now the application can select points for 3 independant data splits (train, valid, test). +* `PatchesExtraction` and `PatchesSelection` don't use the `usenodata` option anymore. Now to use nodata, one simply has to set a parameter value for the nodata (no more default value). + Version 3.0.0-beta (20 nov 2021) ---------------------------------------------------------------- * Use Tensorflow 2 API everywhere. Everything is backward compatible (old models can still be used). -- GitLab From 314ce9c2f6ef9bd663a5925aae27ebe566ebe01c Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:10:02 +0200 Subject: [PATCH 04/11] DOC: update release notes --- RELEASE_NOTES.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index f539756e..30305355 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -2,6 +2,8 @@ Version 3.0.0 (5 apr 2022) ---------------------------------------------------------------- * Add the "split" strategy in the `PatchesSelection` application. Now the application can select points for 3 independant data splits (train, valid, test). * `PatchesExtraction` and `PatchesSelection` don't use the `usenodata` option anymore. Now to use nodata, one simply has to set a parameter value for the nodata (no more default value). +* New python examples in `python/examples/tensorflow_v2x` to illustrate how deterministic models can be quickly built using TensorFlow 2, exporte as SavedModel, and used with OTBTF. +* Change "import gdal" --> "from osgeo import gdal" in otbtf.py Version 3.0.0-beta (20 nov 2021) ---------------------------------------------------------------- -- GitLab From 01ab85a7be355cefbb05de511f337db9e101a103 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:26:28 +0200 Subject: [PATCH 05/11] COMP: update dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34b9b4a4..28ee7875 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN if $GUI; then \ ### Python3 links and pip packages RUN ln -s /usr/bin/python3 /usr/local/bin/python && ln -s /usr/bin/pip3 /usr/local/bin/pip # NumPy version is conflicting with system's gdal dep and may require venv -ARG NUMPY_SPEC="==1.19.*" +ARG NUMPY_SPEC="==1.22.*" RUN pip install --no-cache-dir -U pip wheel mock six future deprecated "numpy$NUMPY_SPEC" \ && pip install --no-cache-dir --no-deps keras_applications keras_preprocessing @@ -40,7 +40,7 @@ WORKDIR /src/tf RUN git config --global advice.detachedHead false ### TF -ARG TF=v2.5.0 +ARG TF=v2.8.0 # Install bazelisk (will read .bazelversion and download the right bazel binary - latest by default) RUN wget -qO /opt/otbtf/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \ && chmod +x /opt/otbtf/bin/bazelisk \ -- GitLab From b424ce87b6248f3a6837d819590b282291023dfc Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 15:26:35 +0200 Subject: [PATCH 06/11] DOC: update release notes --- RELEASE_NOTES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 30305355..f9934e43 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,6 +1,6 @@ -Version 3.0.0 (5 apr 2022) +Version 3.1 (5 apr 2022) ---------------------------------------------------------------- -* Add the "split" strategy in the `PatchesSelection` application. Now the application can select points for 3 independant data splits (train, valid, test). +* Add the "split" strategy in the `PatchesSelection` application. Now the application can select points for 3 independent data splits (train, valid, test). * `PatchesExtraction` and `PatchesSelection` don't use the `usenodata` option anymore. Now to use nodata, one simply has to set a parameter value for the nodata (no more default value). * New python examples in `python/examples/tensorflow_v2x` to illustrate how deterministic models can be quickly built using TensorFlow 2, exporte as SavedModel, and used with OTBTF. * Change "import gdal" --> "from osgeo import gdal" in otbtf.py -- GitLab From 4aaef50ed8ef945239c90d127a7b2b80e6664ed4 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 18:13:47 +0200 Subject: [PATCH 07/11] DOC: update last OTBTF version in README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a462fe5..d1993d5b 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,7 @@ For now you have two options: either use the existing **docker image**, or build Use the latest image from dockerhub: ``` -docker pull mdl4eo/otbtf3.0:cpu -docker run -u otbuser -v $(pwd):/home/otbuser mdl4eo/otbtf3.0:cpu otbcli_PatchesExtraction -help +docker run mdl4eo/otbtf3.1:cpu-basic otbcli_PatchesExtraction -help ``` Read more in the [docker use documentation](doc/DOCKERUSE.md). -- GitLab From c9aae5375d6ff17c85ec7695a75cd1df282ce7d4 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 18:13:57 +0200 Subject: [PATCH 08/11] DOC: update DOCKERUSE --- doc/DOCKERUSE.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/doc/DOCKERUSE.md b/doc/DOCKERUSE.md index 34e58cc3..69382c96 100644 --- a/doc/DOCKERUSE.md +++ b/doc/DOCKERUSE.md @@ -24,8 +24,14 @@ Here is the list of OTBTF docker images hosted on [dockerhub](https://hub.docker | **mdl4eo/otbtf3.0:cpu-basic-dev** | Ubuntu Focal | r2.5 | 7.4.0 | CPU, no optimization (dev) | yes | 5.2,6.1,7.0,7.5,8.6| | **mdl4eo/otbtf3.0:gpu** | Ubuntu Focal | r2.5 | 7.4.0 | GPU | yes | 5.2,6.1,7.0,7.5,8.6| | **mdl4eo/otbtf3.0:gpu-dev** | Ubuntu Focal | r2.5 | 7.4.0 | GPU (dev) | yes | 5.2,6.1,7.0,7.5,8.6| - -- `cpu` tagged docker images are compiled without optimization. +| **mdl4eo/otbtf3.1:cpu-basic** | Ubuntu Focal | r2.8 | 7.4.0 | CPU, no optimization | no | 5.2,6.1,7.0,7.5,8.6| +| **mdl4eo/otbtf3.1:cpu-basic-dev** | Ubuntu Focal | r2.8 | 7.4.0 | CPU, no optimization (dev) | yes | 5.2,6.1,7.0,7.5,8.6| +| **mdl4eo/otbtf3.1:gpu-basic** | Ubuntu Focal | r2.8 | 7.4.0 | GPU | yes | 5.2,6.1,7.0,7.5,8.6| +| **mdl4eo/otbtf3.1:gpu** | Ubuntu Focal | r2.8 | 7.4.0 | GPU, no optimization | yes | 5.2,6.1,7.0,7.5,8.6| +| **mdl4eo/otbtf3.1:gpu-dev** | Ubuntu Focal | r2.8 | 7.4.0 | GPU (dev) | yes | 5.2,6.1,7.0,7.5,8.6| + +- `cpu` tagged docker images are compiled for CPU usage only. +- `xxx-basic` tagged docker images are compiled without CPU optimization flags. Other images are compiled with AVX, SSE, FMA. - `gpu` tagged docker images are suited for **NVIDIA GPUs**. They use CUDA/CUDNN support. - `cpu-mkl` tagged docker image is experimental, it is optimized for Intel CPUs with AVX512 flags. @@ -49,7 +55,7 @@ For instance, suppose you have some data in `/mnt/my_device/` that you want to u The following command shows you how to access the folder from the docker image. ```bash -docker run -v /mnt/my_device/:/data/ -ti mdl4eo/otbtf2.5:cpu bash -c "ls /data" +docker run -v /mnt/my_device/:/data/ -ti mdl4eo/otbtf3.1:cpu-basic bash -c "ls /data" ``` Beware of ownership issues! see the last section of this doc. @@ -62,13 +68,13 @@ You can then use the OTBTF `gpu` tagged docker images with the **NVIDIA runtime* With Docker version earlier than 19.03 : ```bash -docker run --runtime=nvidia -ti mdl4eo/otbtf2.5:gpu bash +docker run --runtime=nvidia -ti mdl4eo/otbtf3.1:gpu bash ``` With Docker version including and after 19.03 : ```bash -docker run --gpus all -ti mdl4eo/otbtf2.5:gpu bash +docker run --gpus all -ti mdl4eo/otbtf3.1:gpu bash ``` You can find some details on the **GPU docker image** and some **docker tips and tricks** on [this blog](https://mdl4eo.irstea.fr/2019/10/15/otbtf-docker-image-with-gpu/). @@ -81,7 +87,7 @@ Be careful though, these infos might be a bit outdated... 1. Install [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps) (Windows Subsystem for Linux) 2. Install [docker desktop](https://www.docker.com/products/docker-desktop) 3. Start **docker desktop** and **enable WSL2** from *Settings* > *General* then tick the box *Use the WSL2 based engine* -3. Open a **cmd.exe** or **PowerShell** terminal, and type `docker create --name otbtf-cpu --interactive --tty mdl4eo/otbtf2.5:cpu` +3. Open a **cmd.exe** or **PowerShell** terminal, and type `docker create --name otbtf-cpu --interactive --tty mdl4eo/otbtf3.1:cpu` 4. Open **docker desktop**, and check that the docker is running in the **Container/Apps** menu  5. From **docker desktop**, click on the icon highlighted as shown below, and use the bash terminal that should pop up! @@ -130,12 +136,12 @@ sudo systemctl {status,enable,disable,start,stop} docker Run a simple command in a one-shot container: ```bash -docker run mdl4eo/otbtf2.5:cpu otbcli_PatchesExtraction +docker run mdl4eo/otbtf3.1:cpu otbcli_PatchesExtraction ``` You can also use the image in interactive mode with bash: ```bash -docker run -ti mdl4eo/otbtf2.5:cpu bash +docker run -ti mdl4eo/otbtf3.1:cpu bash ``` ### Persistent container @@ -145,7 +151,7 @@ Beware of ownership issues, see the last section of this doc. ```bash docker create --interactive --tty --volume /home/$USER:/home/otbuser/ \ - --name otbtf mdl4eo/otbtf2.5:cpu /bin/bash + --name otbtf mdl4eo/otbtf3.1:cpu /bin/bash ``` ### Interactive session @@ -209,7 +215,7 @@ Create a named container (here with your HOME as volume), Docker will automatica ```bash docker create --interactive --tty --volume /home/$USER:/home/otbuser \ - --name otbtf mdl4eo/otbtf2.5:cpu /bin/bash + --name otbtf mdl4eo/otbtf3.1:cpu /bin/bash ``` Start a background container process: -- GitLab From d3ab7fd6b395650b9aafddf6f89e303e228fa001 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 18:14:48 +0200 Subject: [PATCH 09/11] CI: use latest otbtf docker image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c89242c..cfb7f374 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gitlab-registry.irstea.fr/remi.cresson/otbtf/otbtf3.0:cpu-basic-testing +image: gitlab-registry.irstea.fr/remi.cresson/otbtf/otbtf3.1:cpu-basic-testing variables: OTB_BUILD: /src/otb/build/OTB/build # Local OTB build directory -- GitLab From 87d39186b0f371b3fa371686142f5e9ed418f033 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 19:34:52 +0200 Subject: [PATCH 10/11] CI: use latest otbtf docker image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cfb7f374..34f57215 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gitlab-registry.irstea.fr/remi.cresson/otbtf/otbtf3.1:cpu-basic-testing +image: gitlab-registry.irstea.fr/remi.cresson/otbtf/otbtf:3.1-cpu-basic-testing variables: OTB_BUILD: /src/otb/build/OTB/build # Local OTB build directory -- GitLab From bbac09904e3da670c47ba6a08a6771cc6e6881e4 Mon Sep 17 00:00:00 2001 From: Remi Cresson <remi.cresson@irstea.fr> Date: Tue, 5 Apr 2022 19:36:17 +0200 Subject: [PATCH 11/11] CI: use latest otbtf docker image --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34f57215..5cfe0b9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gitlab-registry.irstea.fr/remi.cresson/otbtf/otbtf:3.1-cpu-basic-testing +image: gitlab-registry.irstea.fr/remi.cresson/otbtf:3.1-cpu-basic-testing variables: OTB_BUILD: /src/otb/build/OTB/build # Local OTB build directory -- GitLab