Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom semantic segmentation trainer tutorial #1897

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6fca51b
Added custom segmentation trainer tutorial
calebrob6 Feb 21, 2024
c8bb544
Black formatting
calebrob6 Feb 21, 2024
604bc1f
Updates
calebrob6 Feb 22, 2024
e679143
black formatting
calebrob6 Feb 22, 2024
a9808c5
Adding a jupytext synced python file
calebrob6 Feb 23, 2024
b57d745
Trying jupytext
calebrob6 Feb 23, 2024
f1f4c63
Linting
calebrob6 Feb 23, 2024
c43526d
Typo fix and constructor fix
calebrob6 Feb 23, 2024
5a20899
Trainer args
calebrob6 Feb 23, 2024
c7090d1
Update num epochs
calebrob6 Feb 23, 2024
9c0cff2
Make base trainer class work properly
calebrob6 Feb 23, 2024
c4734e5
Updating kernelspec name
calebrob6 Feb 23, 2024
8a2abc5
Make mypy happy I think
calebrob6 Feb 23, 2024
a6f7045
Add tutorial to docs
calebrob6 Feb 23, 2024
fe3dd34
Linting
calebrob6 Feb 23, 2024
cdd43a9
Adding torchgeo datasets install
calebrob6 Feb 23, 2024
1a59301
Ruff
calebrob6 Sep 18, 2024
27953c2
Update to notebook
calebrob6 Sep 18, 2024
5fc368e
Adding some comments
calebrob6 Sep 18, 2024
7a6dc06
Remove the .py file
calebrob6 Sep 18, 2024
d7402fd
Download less data
calebrob6 Sep 20, 2024
c4c02ec
ruff
calebrob6 Sep 20, 2024
4acc493
nbstripout
calebrob6 Sep 20, 2024
62663de
See if removing pip installs help
calebrob6 Sep 20, 2024
ef438f2
What is going on?
calebrob6 Sep 20, 2024
2092f43
Try pip installs again
calebrob6 Sep 20, 2024
037fc01
Ruff
calebrob6 Sep 20, 2024
30c76da
Update docs/tutorials/custom_segmentation_trainer.ipynb
calebrob6 Oct 1, 2024
0c4aa0d
Update docs/tutorials/custom_segmentation_trainer.ipynb
calebrob6 Oct 1, 2024
fed6524
Update docs/tutorials/custom_segmentation_trainer.ipynb
calebrob6 Oct 1, 2024
94718ab
Update docs/tutorials/custom_segmentation_trainer.ipynb
calebrob6 Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ torchgeo

tutorials/getting_started
tutorials/custom_raster_dataset
tutorials/custom_segmentation_trainer
tutorials/transforms
tutorials/indices
tutorials/trainers
Expand Down
8 changes: 2 additions & 6 deletions docs/tutorials/custom_raster_dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@
"source": [
"root = os.path.join(tempfile.gettempdir(), 'sentinel')\n",
"item_urls = [\n",
" 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items/S2B_MSIL2A_20220902T090559_R050_T40XDH_20220902T181115',\n",
" 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items/S2B_MSIL2A_20220718T084609_R107_T40XEJ_20220718T175008',\n",
" 'https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items/S2B_MSIL2A_20220902T090559_R050_T40XDH_20220902T181115'\n",
" #'https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items/S2B_MSIL2A_20220718T084609_R107_T40XEJ_20220718T175008',\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to delete these commented out files or uncomment them?

"]\n",
"\n",
"for item_url in item_urls:\n",
Expand Down Expand Up @@ -540,10 +540,6 @@
}
],
"metadata": {
"colab": {
"collapsed_sections": [],
"provenance": []
},
"execution": {
"timeout": 1200
},
Expand Down
514 changes: 514 additions & 0 deletions docs/tutorials/custom_segmentation_trainer.ipynb

Large diffs are not rendered by default.

51 changes: 23 additions & 28 deletions docs/tutorials/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "35303546",
"id": "0",
"metadata": {},
"source": [
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "markdown",
"id": "9478ed9a",
"id": "1",
"metadata": {
"id": "NdrXRgjU7Zih"
},
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "markdown",
"id": "34f10e9f",
"id": "2",
"metadata": {
"id": "lCqHTGRYBZcz"
},
Expand All @@ -39,7 +39,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "019092f0",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -48,7 +48,7 @@
},
{
"cell_type": "markdown",
"id": "4db9f791",
"id": "4",
"metadata": {
"id": "dV0NLHfGBMWl"
},
Expand All @@ -61,7 +61,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3d92b0f1",
"id": "5",
"metadata": {
"id": "entire-albania"
},
Expand All @@ -79,7 +79,7 @@
},
{
"cell_type": "markdown",
"id": "7f26e4b8",
"id": "6",
"metadata": {
"id": "5rLknZxrBEMz"
},
Expand All @@ -92,7 +92,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4a39af46",
"id": "7",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -154,10 +154,10 @@
" 'https://naipeuwest.blob.core.windows.net/naip/v002/de/2018/de_060cm_2018/38075/'\n",
")\n",
"tiles = [\n",
" 'm_3807511_ne_18_060_20181104.tif',\n",
" 'm_3807511_se_18_060_20181104.tif',\n",
" 'm_3807512_nw_18_060_20180815.tif',\n",
" 'm_3807512_sw_18_060_20180815.tif',\n",
" 'm_3807511_ne_18_060_20181104.tif'\n",
" #'m_3807511_se_18_060_20181104.tif',\n",
" #'m_3807512_nw_18_060_20180815.tif',\n",
" #'m_3807512_sw_18_060_20180815.tif',\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

"]\n",
"for tile in tiles:\n",
" download_url(naip_url + tile, naip_root)\n",
Expand All @@ -167,7 +167,7 @@
},
{
"cell_type": "markdown",
"id": "e25bad40",
"id": "8",
"metadata": {
"id": "HQVji2B22Qfu"
},
Expand All @@ -178,7 +178,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "689bb2b0",
"id": "9",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
Expand All @@ -195,7 +195,7 @@
},
{
"cell_type": "markdown",
"id": "56f2d78b",
"id": "10",
"metadata": {
"id": "OWUhlfpD22IX"
},
Expand All @@ -206,7 +206,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "daefbc4d",
"id": "11",
"metadata": {
"id": "WXxy8F8l2-aC"
},
Expand All @@ -217,7 +217,7 @@
},
{
"cell_type": "markdown",
"id": "ded44652",
"id": "12",
"metadata": {
"id": "yF_R54Yf3EUd"
},
Expand All @@ -230,7 +230,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b8a0d99c",
"id": "13",
"metadata": {
"id": "RLczuU293itT"
},
Expand All @@ -241,7 +241,7 @@
},
{
"cell_type": "markdown",
"id": "5b8c1c52",
"id": "14",
"metadata": {
"id": "OWa-mmYd8S6K"
},
Expand All @@ -254,7 +254,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "96faa142",
"id": "15",
"metadata": {
"id": "jfx-9ZmU8ZTc"
},
Expand All @@ -265,7 +265,7 @@
},
{
"cell_type": "markdown",
"id": "64ae63f7",
"id": "16",
"metadata": {
"id": "HZIfqqW58oZe"
},
Expand All @@ -278,7 +278,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8a2b44f8",
"id": "17",
"metadata": {
"id": "7sGmNvBy8uIg"
},
Expand All @@ -291,11 +291,6 @@
}
],
"metadata": {
"colab": {
"collapsed_sections": [],
"name": "getting_started.ipynb",
"provenance": []
},
"execution": {
"timeout": 1200
},
Expand All @@ -314,7 +309,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
3 changes: 0 additions & 3 deletions docs/tutorials/indices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@
}
],
"metadata": {
"colab": {
"provenance": []
},
"execution": {
"timeout": 1200
},
Expand Down
3 changes: 0 additions & 3 deletions docs/tutorials/pretrained_weights.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,6 @@
],
"metadata": {
"accelerator": "GPU",
"colab": {
adamjstewart marked this conversation as resolved.
Show resolved Hide resolved
"provenance": []
},
"execution": {
"timeout": 1200
},
Expand Down
Loading