cd ~/
mkdir usf
cd usf
# part1
git clone https://github.com/fastai/courses.git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
function set_dir { | |
SOURCE_DIR=$1 | |
if [ -z "$2" ] | |
then | |
TARGET_DIR=$1 | |
else | |
TARGET_DIR=$2 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import subprocess | |
from glob import glob | |
import gdal | |
import gdalconst as gc | |
import os | |
from time import time | |
from datetime import timedelta | |
from alert_config import TIF_DIR, CSV_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# add to bashrc | |
# | |
# files | |
alias sampletree='mkdir -p sample/{train,test,valid}' | |
lsn(){ matchdir=`pwd`/$2; find $matchdir -type f | grep -v sample | shuf -n $1 | awk -F`pwd` '{print "."$NF}' ; } | |
# shuffle mv/cp | |
cpn(){ matchdir=`pwd`/$2; find $matchdir -type f | grep -v sample | shuf -n $1 | awk -F`pwd` '{print "."$NF" sample"$NF}' | xargs -t -n2 cp ; } | |
mvn(){ matchdir=`pwd`/$2; todir=`pwd`/$3; find $matchdir -type f | grep -v sample | shuf -n $1 | awk -F`pwd` -v todir="$todir" '{print $0" "todir}' | xargs -t -n2 mv ; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~/ | |
### CUDA | |
echo "\n\nChecking for CUDA and installing." | |
if ! dpkg-query -W cuda; then | |
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |
sudo dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |
sudo apt-get update | |
sudo apt-get install cuda -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>TCD Tile Comparison</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<!-- Load Leaflet from CDN--> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/0.7.7/leaflet.css" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import httplib2 | |
from googleapiclient import discovery | |
from oauth2client.client import GoogleCredentials | |
from oauth2client.service_account import ServiceAccountCredentials | |
from apiclient.http import MediaFileUpload | |
KEY_FILE='/.config/gclib/sa_key.json' | |
FT_SCOPE = 'https://www.googleapis.com/auth/fusiontables' | |
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import re | |
import click | |
import rasterio | |
CLR_IDENT='clr' | |
CMAP={ | |
1: (48, 124, 38), | |
2: (138, 216, 168), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
from multiprocessing import Process, cpu_count | |
from multiprocessing import Pool | |
from multiprocessing.pool import ThreadPool | |
# | |
# CONFIG | |
# | |
MAX_POOL_PROCESSES=cpu_count()-1 |
OlderNewer