This file contains 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 | |
caffe.set_mode_cpu() | |
import numpy as np | |
from numpy import prod, sum | |
from pprint import pprint | |
def print_net_parameters (deploy_file): | |
print "Net: " + deploy_file | |
net = caffe.Net(deploy_file, caffe.TEST) | |
print "Layer-wise parameters: " |
This file contains 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 matplotlib.pyplot as plt | |
def plot_cmap(cmap, ncolor): | |
""" | |
A convenient function to plot colors of a matplotlib cmap | |
Args: | |
ncolor (int): number of color to show | |
cmap: a cmap object or a matplotlib color name | |
""" |