Skip to content

Commit

Permalink
Update nd_parser.ipynb with TensorFlow optimization and NDVI calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Byrne committed Jan 30, 2024
1 parent 3e59e51 commit df5ba50
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions notebooks/nd_parser.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -24,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -35,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -66,16 +76,16 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f8841523640>"
"<matplotlib.image.AxesImage at 0x7f8360886e20>"
]
},
"execution_count": 29,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -112,24 +122,24 @@
"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."
]
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.colorbar.Colorbar at 0x7f8841d05b50>"
"<matplotlib.colorbar.Colorbar at 0x7f8360c88970>"
]
},
"execution_count": 30,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -164,16 +174,16 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.colorbar.Colorbar at 0x7f8891590310>"
"<matplotlib.colorbar.Colorbar at 0x7f83406da370>"
]
},
"execution_count": 31,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -206,16 +216,16 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f8852141a90>"
"<matplotlib.image.AxesImage at 0x7f8371e0bcd0>"
]
},
"execution_count": 32,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -246,16 +256,16 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x7f8841d66d00>"
"<matplotlib.image.AxesImage at 0x7f82f0d18490>"
]
},
"execution_count": 33,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
Expand Down Expand Up @@ -293,7 +303,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -317,7 +327,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit df5ba50

Please sign in to comment.