Skip to main content

Extract motion energy features from video using spatio-temporal Gabors

Project description

Zenodo Github Codecov Python

What is pymoten?

pymoten is a python package that provides a convenient way to extract motion energy features from video using a pyramid of spatio-temporal Gabor filters [1] [2]. The filters are created at multiple spatial and temporal frequencies, directions of motion, x-y positions, and sizes. Each filter quadrature-pair is convolved with the video and their activation energy is computed for each frame. These features provide a good basis to model brain responses to natural movies [3] [4].

Installation

Using pip, install the latest version from git:

pip install git+https://github.com/gallantlab/pymoten.git

Or the most recent release:

pip install pymoten

Getting started

Example using synthetic data

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)

Simple example using a video file

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)

Cite as

Nunez-Elizalde AO, Deniz F, Dupré la Tour T, Visconti di Oleggio Castello M, and Gallant JL (2021). pymoten: scientific python package for computing motion energy features from video. Zenodo. https://doi.org/10.5281/zenodo.6349625

References


A MATLAB implementation can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymoten-0.1.0.tar.gz (58.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymoten-0.1.0-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

Details for the file pymoten-0.1.0.tar.gz.

File metadata

  • Download URL: pymoten-0.1.0.tar.gz
  • Upload date:
  • Size: 58.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymoten-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9eaaa31af1cc220db7ed4c1667d6090152106193a97b429fb6b44545c46af7cd
MD5 83191de80380dc58db6162585bcfaf81
BLAKE2b-256 b436955b08db0a92a2545caad11aad4aebb0e8f9ed45c79c241a322c93935539

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymoten-0.1.0.tar.gz:

Publisher: publish_to_pypi.yml on gallantlab/pymoten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymoten-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymoten-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymoten-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41b8556f1a3b438ff58900918ba0cd3c4d71b9f556cf45195587ea09fc0db377
MD5 acc26f656b60235890aa415df7f178e4
BLAKE2b-256 75041b45ec94845ee3e09bdce7e2f435d03be38381f76132c1a1fe5097b06ffc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymoten-0.1.0-py3-none-any.whl:

Publisher: publish_to_pypi.yml on gallantlab/pymoten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page