From df5ba50b7ce1680675ff497c8e3b3b2c80b5603e Mon Sep 17 00:00:00 2001 From: Adam Byrne Date: Tue, 30 Jan 2024 20:04:34 +0000 Subject: [PATCH] Update nd_parser.ipynb with TensorFlow optimization and NDVI calculation --- notebooks/nd_parser.ipynb | 54 +++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/notebooks/nd_parser.ipynb b/notebooks/nd_parser.ipynb index 8a46300..1471c49 100644 --- a/notebooks/nd_parser.ipynb +++ b/notebooks/nd_parser.ipynb @@ -11,11 +11,21 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2024-01-30 20:03:19.555982: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n", + "To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" + ] + } + ], "source": [ "import os\n", + "import cv2\n", "import pathlib\n", "import numpy as np\n", "import tensorflow as tf\n", @@ -24,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -35,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -66,16 +76,16 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 29, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" }, @@ -112,7 +122,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# NDVI calculated from NIR and RGB bands\n", + "# NDVI calculated from NIR and RED bands\n", "`NDVI = (NIR - RED) / (NIR + RED)`\n", "\n", "Normalised difference vegetation index (NDVI) is a simple graphical indicator that can be used to analyse remote sensing measurements, typically but not necessarily from a space platform, and assess whether the target being observed contains live green vegetation or not." @@ -120,16 +130,16 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 30, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, @@ -164,16 +174,16 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 31, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, @@ -206,16 +216,16 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 32, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" }, @@ -246,16 +256,16 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 33, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" }, @@ -293,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -317,7 +327,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 10, "metadata": {}, "outputs": [ {