Skip to content

Instantly share code, notes, and snippets.

View calebrob6's full-sized avatar

Caleb Robinson calebrob6

View GitHub Profile
@calebrob6
calebrob6 / Download seasonal data from PC.ipynb
Created April 9, 2023 23:15
An example of how to download seasonal patches from the Planetary Computer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / Example for creating a Landsat and NLCD dataset.ipynb
Created April 7, 2023 22:01
Example notebook that shows how to create TorchGeo datasets from Landsat and NLCD data downloaded from the Planetary Computer.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / inference.py
Created April 4, 2023 04:08
Inference script for torchgeo
#!/usr/bin/env python
""""""
import argparse
import math
import os
import time
import numpy as np
import rasterio
@calebrob6
calebrob6 / Finetuning with TorchGeo pre-trained models.ipynb
Created February 8, 2023 21:58
Example notebook that shows how to do linear-probing with a TorchGeo pre-trained model.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / fast_ious.ipynb
Last active February 2, 2023 19:05
This notebook compares the speed of scikit-learn's implementation for computing the per-class IoU between two arrays to a simple custom implementation with numpy. We find that the custom implementation scales better by a constant exponent.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / landcoverai_randomforest.py
Created January 22, 2023 18:21
Script for training a random forest on the LandCover.AI dataset
import time
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import jaccard_score
from torch.utils.data import DataLoader
from tqdm import tqdm
from torchgeo.datasets import LandCoverAI
@calebrob6
calebrob6 / Chesapeake training example.ipynb
Created December 21, 2022 21:10
Example of how to use TorchGeo to train a semantic segmentation model on the ChesapeakeCVPR dataset.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / bing_geodata_api.py
Created November 24, 2022 00:15
A class / command line script for interacting with Bing's Geodata API -- https://learn.microsoft.com/en-us/bingmaps/spatial-data-services/geodata-api
import argparse
import math
import time
import fiona
import fiona.transform
import requests
import shapely.geometry
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@calebrob6
calebrob6 / Greedy polygon merging.ipynb
Created October 26, 2022 04:55
A notebook that merges adjacent polygons up to a maximum area cutoff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.