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 threading import Thread | |
from functools import wraps | |
def spawns(func): | |
@wraps(func) | |
def spawned(*args, **kwargs): | |
thread = Thread(target=func, args=args, kwargs=kwargs) | |
thread.start() | |
return thread | |
return spawned |
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
find . -type f | cut -d/ -f2 | sort | uniq -c | |
#find. -type f to find all items of the type file | |
#cut -d/ -f2 to cut out their specific folder | |
#sort to sort the list of foldernames | |
#uniq -c to return the number of times each foldername has been counted |
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 caffe | |
import numpy as np | |
mean = np.load('mean.npy').mean(1).mean(1) | |
image_dims = (224, 244) | |
model = 'deploy.prototxt' | |
weights = 'resnet-50.caffemodel' | |
net = caffe.Classifier(model, weights, image_dims=image_dims, mean=mean, raw_scale=255, channel_swap=[2, 1, 0]) |