### Install pymoten using pip Source: https://github.com/gallantlab/pymoten/blob/main/docs/source/index.md Install the latest version of pymoten from GitHub or the most recent release from PyPI. ```bash pip install git+https://github.com/gallantlab/pymoten.git ``` ```bash pip install pymoten ``` -------------------------------- ### Install Latest PyMoten Release Source: https://github.com/gallantlab/pymoten/blob/main/README.rst Install the most recent stable release of PyMoten from PyPI using pip. ```bash pip install pymoten ``` -------------------------------- ### Install PyMoten from GitHub Source: https://github.com/gallantlab/pymoten/blob/main/README.rst Install the latest version of PyMoten directly from its GitHub repository using pip. ```bash pip install git+https://github.com/gallantlab/pymoten.git ``` -------------------------------- ### Enable GPU acceleration with PyTorch Source: https://github.com/gallantlab/pymoten/blob/main/docs/source/index.md Switch to a GPU backend (torch_cuda or torch_mps) for faster computation. This requires PyTorch to be installed. The stimulus is moved to the GPU, projected, and then converted back to NumPy. ```python import moten from moten.backend import set_backend # Switch to a GPU backend (returns the backend module) backend = set_backend("torch_cuda") pyramid = moten.get_default_pyramid(vhsize=(vdim, hdim), fps=24) # Move the stimulus onto the GPU, project, then bring the result back stimulus_gpu = backend.asarray(luminance_images) moten_features = pyramid.project_stimulus_batched(stimulus_gpu) moten_features = backend.to_numpy(moten_features) ``` -------------------------------- ### Build Pymoten Website Source: https://github.com/gallantlab/pymoten/blob/main/docs/README.md Commands to navigate to the docs directory, build the website, and open it in Firefox. ```bash cd docs make githubio-docs firefox build/html/index.html ``` -------------------------------- ### Pymoten Website Requirements Source: https://github.com/gallantlab/pymoten/blob/main/docs/README.md Lists the Python packages required to build the Pymoten website. ```bash numpydoc sphinx sphinx_gallery sphinx_bootstrap_theme ``` -------------------------------- ### Compute motion energy features from a video file Source: https://github.com/gallantlab/pymoten/blob/main/docs/source/index.md Stream a video file, convert it to luminance images, and compute motion energy features using a Gabor filter pyramid. ```python import moten # Stream and convert the RGB video into a sequence of luminance images video_file = 'http://anwarnunez.github.io/downloads/avsnr150s24fps_tiny.mp4' luminance_images = moten.io.video2luminance(video_file, nimages=100) # Create a pyramid of spatio-temporal gabor filters nimages, vdim, hdim = luminance_images.shape pyramid = moten.get_default_pyramid(vhsize=(vdim, hdim), fps=24) # Compute motion energy features moten_features = pyramid.project_stimulus(luminance_images) ``` -------------------------------- ### Compute motion energy features from synthetic data Source: https://github.com/gallantlab/pymoten/blob/main/docs/source/index.md Generate synthetic video data and compute motion energy features using a default Gabor filter pyramid. ```python import moten import numpy as np # Generate synthetic data nimages, vdim, hdim = (100, 90, 180) noise_movie = np.random.randn(nimages, vdim, hdim) # Create a pyramid of spatio-temporal gabor filters pyramid = moten.get_default_pyramid(vhsize=(vdim, hdim), fps=24) # Compute motion energy features moten_features = pyramid.project_stimulus(noise_movie) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.