Caffe2 - Python API
A deep learning, cross platform ML framework
Public Member Functions | Public Attributes | List of all members
caffe2.python.visualize.PatchVisualizer Class Reference
Inheritance diagram for caffe2.python.visualize.PatchVisualizer:

Public Member Functions

def __init__ (self, gap=1)
 
def ShowSingle (self, patch, cmap=None)
 
def ShowMultiple (self, patches, ncols=None, cmap=None, bg_func=np.mean)
 
def ShowImages (self, patches, args, kwargs)
 
def ShowChannels (self, patch, cmap=None, bg_func=np.mean)
 
def get_patch_shape (self, patch)
 

Public Attributes

 gap
 

Detailed Description

PatchVisualizer visualizes patches.

Definition at line 28 of file visualize.py.

Member Function Documentation

def caffe2.python.visualize.PatchVisualizer.get_patch_shape (   self,
  patch 
)
Gets the shape of a single patch.

    Basically it tries to interprete the patch as a square, and also check if it
    is in color (3 channels)

Definition at line 115 of file visualize.py.

def caffe2.python.visualize.PatchVisualizer.ShowChannels (   self,
  patch,
  cmap = None,
  bg_func = np.mean 
)
This function shows the channels of a patch.

    The incoming patch should have shape [w, h, num_channels], and each channel
    will be visualized as a separate gray patch.

Definition at line 104 of file visualize.py.

def caffe2.python.visualize.PatchVisualizer.ShowImages (   self,
  patches,
  args,
  kwargs 
)
Similar to ShowMultiple, but always normalize the values between 0 and 1
    for better visualization of image-type data.

Definition at line 96 of file visualize.py.

def caffe2.python.visualize.PatchVisualizer.ShowMultiple (   self,
  patches,
  ncols = None,
  cmap = None,
  bg_func = np.mean 
)
Visualize multiple patches.

    In the passed in patches matrix, each row is a patch, in the shape of either
    n*n, n*n*1 or n*n*3, either in a flattened format (so patches would be a
    2-D array), or a multi-dimensional tensor. We will try our best to figure
    out automatically the patch size.

Definition at line 52 of file visualize.py.

def caffe2.python.visualize.PatchVisualizer.ShowSingle (   self,
  patch,
  cmap = None 
)
Visualizes one single patch.

    The input patch could be a vector (in which case we try to infer the shape
    of the patch), a 2-D matrix, or a 3-D matrix whose 3rd dimension has 3
    channels.

Definition at line 35 of file visualize.py.


The documentation for this class was generated from the following file: