pulse2percept.stimuli.samples.ucsb_pedestrians
- pulse2percept.stimuli.samples.ucsb_pedestrians(resize=None, electrodes=None, metadata=None, as_gray=False)[source]
UCSB pedestrians clip
Load a 346x640x3 RGB shot of pedestrians on the UCSB campus, 45 frames at 24.52 fps (1.84 s of video).
The clip is cut from Towards a Smart Bionic Eye, produced by the National Library of Medicine / National Institutes of Health. As a U.S. government work it is in the public domain in the United States, and is therefore not covered by pulse2percept’s BSD license;
metadatacarries the requested attribution.The clip has no intrinsic field of view; wrap it in a
Sceneto say how much of the visual field it covers.Note
The source is variable-frame-rate, so the reader resamples it to a constant rate: about 9 of the 45 frames repeat the frame before them.
Added in version 0.11.0.
- Parameters:
resize (
(height, width)or None, optional) – A tuple specifying the desired height and the width of each video frame.electrodes (int, string or list thereof; optional) –
Optionally, you can provide your own electrode names. If none are given, each pixel is named after its place in the frame: a letter for the row, a number for the column, and a suffix for the color channel (e.g. ‘A1’, ‘C12’, ‘A1_R’).
Note
The number of electrode names provided must match the number of pixels in the (resized) frame.
metadata (dict, optional) – Additional stimulus metadata can be stored in a dictionary. Keys given here override the attribution defaults above.
as_gray (bool, optional) – Flag whether to convert the video to grayscale.
- Returns:
stim
- Return type:
Examples
>>> from pulse2percept.stimuli import samples >>> samples.ucsb_pedestrians(resize=(60, 80)).vid_shape (60, 80, 3, 45)