Skip to content

Instantly share code, notes, and snippets.

View Geoyi's full-sized avatar
It's all about colors.

Zhuangfang Yi 依庄防 Geoyi

It's all about colors.
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
wronk /
Last active July 5, 2024 15:08
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.

h/t @sharkinsspatial for linking me to the perfect cartoon

dnlglsn /
Created September 14, 2017 22:21
Export a checkpointed object_detection model for serving with TensorFlow Serving
Unfortunately, the tutorial for saving a model for inference "freezes" the
variables in place and makes them unservable by tensorflow_serving. exports an empty "variables" directory, which needs to
be populated.
EvenOldridge /
Last active January 11, 2019 21:42
Export a Keras Model for Tensorflow Serving
import numpy as np
import tensorflow as tf
import keras as k
from keras.applications.resnet50 import ResNet50
from keras import backend as K
from keras.layers.core import Flatten, Dense, Dropout, Lambda
from keras.models import Model
from keras.preprocessing import image
nishadhka / rastermerege-rasterio,py
Created July 30, 2017 12:05
Raster merge using rasterio
import rasterio.merge
def merge(input1,bounds, res, nodata, precision):
import warnings
warnings.warn("Deprecated; Use rasterio.merge instead", DeprecationWarning)
simbamangu / ExifTool geotagging and
Last active January 31, 2022 10:49
Geotag folder with ExifTool

Geotagging with ExifTool and a tracklog

This is a brief guide to using ExifTool to geotag a folder of images.

  • On OSX: get ExifTool with Homebrew: brew install exiftool
  • Ubuntu/Mint: sudo apt install exiftool
  • On Windows: download from the ExifTool website. Replace exiftool with exiftool.exe in the examples here!


fchollet /
Last active September 13, 2023 03:34
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
It uses data that can be downloaded at:
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
bonzanini /
Last active April 18, 2024 11:57
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream
chitchcock /
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real