Skip to content

Instantly share code, notes, and snippets.

@adamjstewart
Created May 5, 2022 21:54
Show Gist options
  • Save adamjstewart/0dcb61d192bbea5087b78282480f8436 to your computer and use it in GitHub Desktop.
Save adamjstewart/0dcb61d192bbea5087b78282480f8436 to your computer and use it in GitHub Desktop.
Plotting NDVI with TorchGeo
transform = AppendNDVI(index_red=0, index_nir=3)
sample = transform(sample)
sample["image"][-1] = (sample["image"][-1] + 1) / 2
plt.imshow(sample["image"][-1], cmap="RdYlGn_r")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment