vtem.vtem.VTEM_CS_IAF¶
- vtem.vtem.VTEM_CS_IAF(videofile, output_filename, Wt, Wx=25.132741228718345, Wy=25.132741228718345, start_frame=0, end_frame=None, dx=0.0625, dy=0.0625, fps=100, domain=None, h5input=True)¶
Encode a video with IAF neurons and gabor receptive field with default parameters
Parameters: videofile : string
Either 1. Filename of a file containing the input video must be stored using write_memory_to_file in simpleio.py or using h5write in matlab Video array with shape (a,b,c) a: total number of frames b: number of pixels in y direction c: number of pixels in x direction c is the leading dimension in matlab should be (c,b,a) 2. Or filename of a video file if h5input is set to False. Will throw an error if OpenCV and the required codec are not installed
output_filename : string
output filename that will contain the spike info
Wt : float
bandwidth in t variable if not specified, will use the info in spikefile
Wx : float, optional
bandwidth in x variable if not specified, will use the info in spikefile
Wy : float, optional
bandwidth in y variable if not specified, will use the info in spikefile
start_frame : integer, optional
starting frame to be encoded in the video
end_frame : integer, optional
ending frame to be encoded if not specified, will encoding to the end of the video
dx : integer, optional
spatial resolution in x direction, distance between two pixels
dy: integer, optional
spatial resolution in y direction, distance between two pixels
fps : integer, optional
frames per second of the video
domain : list, optional
list of 2, [a,b], specifying the domain to encode a in x direction, b in y direction will only encode the center of the video with size [a,b] if not specified, the whole video screen will be encoded.
h5input : bool, optional
True if the file specified is an h5 file. False if the file specified is a video file. If not specified, is set to True
Notes
The coordinate system is given by the following
Row (width / X) major -----------------------------------------> width | Y | ^--------------------> | |--------------------> | |--------------------> | |--------------------> X | | v height
To specify receptive field parameters, create an object using vrf.vrf_cs() with desired parameters and use function VTEM_IAF
Examples
>>> import atexit >>> import pycuda.driver as cuda >>> import numpy as np >>> from vtem import vtem,vtdm >>> cuda.init() >>> context1 = cuda.Device(0).make_context() >>> atexit.register(cuda.Context.pop) >>> vtem.VTEM_CS_IAF('video.h5', 'spikes.h5', 2*np.pi*10)