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
# This is all 'experimental code'; it loosely follows the instructions from | |
# the 'ImageNet classification' and 'Filter visualization' ipynb tutorials from | |
# http://caffe.berkeleyvision.org/ | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Make sure that caffe is on the python path: | |
caffe_root = '../../caffe-master/' |
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 cv2 | |
import sys | |
old_class = 0 | |
truth = 0 | |
w_file = open(sys.argv[1], 'w') | |
b_file = open(sys.argv[2], 'w') | |
m_file = open(sys.argv[3], 'w') | |
with open('test.txt') as f: |
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 bash | |
# Installation script for Deep Learning Libraries on Ubuntu 14.04, by Roelof Pieters (@graphific) | |
# BSD License | |
orig_executor="$(whoami)" | |
if [ "$(whoami)" == "root" ]; then | |
echo "running as root, please run as user you want to have stuff installed as" | |
exit 1 | |
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
bool ReadCSVToDatum(const string& filename, Datum* datum) { | |
// read in the CSV file into a vector | |
fstream file(filename.c_str(), ios::in); | |
vector<vector<int> > label; | |
std::string line; | |
while (std::getline(file, line)) { | |
// replace commas with spaces | |
for (int i = 0; i < line.length(); i++) { | |
if (line[i] == ',') | |
line[i] = ' '; |
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 numpy as np | |
import random | |
from PIL import Image | |
import numpy as np | |
import h5py | |
import matplotlib.pyplot as plt | |
import glob |
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, sys | |
import cv2 | |
import argparse | |
from multiprocessing import Process | |
def vid_to_images(video_file, output_dir, skip_frames = 0): | |
print 'Processing video:', video_file | |
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 division | |
import cv2 | |
import cv2.cv as cv | |
import sys | |
import pdb | |
def detect(img, cascade): | |
rects = cascade.detectMultiScale(img, scaleFactor=1.1, minNeighbors=3, minSize=(10, 10), flags = cv.CV_HAAR_SCALE_IMAGE) | |
if len(rects) == 0: | |
return [] |
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
def generateHDF5FromText2(label_num): | |
print '\nplease wait...' | |
HDF5_FILE = ['hdf5_train.h5', 'hdf5_test1.h5'] | |
#store the training and testing data path and labels | |
LIST_FILE = ['train.txt','test.txt'] | |
for kk, list_file in enumerate(LIST_FILE): | |
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
name: "MYNET" | |
input: "data" | |
input_dim: 1 | |
input_dim: 3 | |
input_dim: 224 | |
input_dim: 224 | |
layer { | |
name: "conv1/7x7_s2" | |
type: "Convolution" | |
bottom: "data" |