def make_net(mean=None, net_dir='VGG_S_rgb'):
# net_dir specifies type of network
# Options are: (rgb, lbp, cyclic_lbp, cyclic_lbp_5, cyclic_lbp_10)
caffe_root = '/home/gshine/Data/Caffe'
sys.path.insert(0, caffe_root + 'python')
plt.rcParams['figure.figsize'] = (10, 10)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
net_root = 'models'
net_pretrained = os.path.join(net_root, net_dir, 'EmotiW_VGG_S.caffemodel')
net_model_file = os.path.join(net_root, net_dir, 'deploy.prototxt')
VGG_S_Net = caffe.Classifier(net_model_file, net_pretrained,
mean=mean,
channel_swap=(2,1,0),
raw_scale=255,
image_dims=(256, 256))
return VGG_S_Net
# Load a minibatch of images
评论列表
文章目录