Skip to content

Instantly share code, notes, and snippets.

View aaronpolhamus's full-sized avatar
💭
🤘🤓🤘

Aaron Polhamus aaronpolhamus

💭
🤘🤓🤘
View GitHub Profile
@aaronpolhamus
aaronpolhamus / model.py
Last active March 26, 2016 22:31
Adaptation of VGG-like convnet for custom data from http://keras.io/examples/
import os
import sys
import json
import model_control
from numpy import loadtxt, asarray
from pandas import read_csv
from scipy.ndimage import imread
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
model = Sequential()
model.add(Convolution2D(64, 3, 3, border_mode='valid', input_shape=(1, 128, 128)))
model.add(Activation('relu'))
model.add(Convolution2D(64, 3, 3))
model.add(MaxPooling2D((2,2), strides=(2,2)))
model.add(Activation('relu'))
model.add(Convolution2D(128, 3, 3))
model.add(Activation('relu'))
model.add(Convolution2D(128, 3, 3))
@aaronpolhamus
aaronpolhamus / deploy_updated.prototxt
Created May 12, 2016 01:11
deploy.prototxt from the caffe implementation of GoogleNet tweaked to have batch size=1 instead of =10
name: "GoogleNet"
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 1 dim: 3 dim: 224 dim: 224 } }
}
layer {
name: "conv1/7x7_s2"
type: "Convolution"
@aaronpolhamus
aaronpolhamus / Makefile.config
Created May 20, 2016 19:57
Makefile for AWS config of caffe with GPU/CUDA
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@aaronpolhamus
aaronpolhamus / blacknyellow.terminal
Created June 3, 2016 00:05
bash terminal settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.39305455500335362</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEDUw
We couldn’t find that file to show.
@aaronpolhamus
aaronpolhamus / sshd_config
Created June 7, 2016 19:38
/etc/sshd_config (remote server)
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
@aaronpolhamus
aaronpolhamus / ssh_config
Created June 7, 2016 19:56
/etc/ssh_config (local client)
# $OpenBSD: ssh_config,v 1.26 2010/01/11 01:39:46 dtucker Exp $
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
@aaronpolhamus
aaronpolhamus / plot.py
Created June 8, 2016 20:55
run this script interactively to test whether python is connecting to X11 as expected
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2*np.pi*t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
import numpy as np
import cv2
file_name = '/home/ubuntu/motocross.mp4'
cap = cv2.VideoCapture(file_name)
counter = 0
while(True):
# Capture frame-by-frame