#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('pylab', 'inline') from pyannote.core import notebook # # SlidingWindowFeature (`pyannote.core.feature.SlidingWindowFeature`) # In[2]: from pyannote.core import SlidingWindowFeature, SlidingWindow # **SlidingWindowFeature** are used to manage feature vectors extracted on a sliding window (e.g. MFCC in audio processing). # In[3]: # one 4-dimensional feature vector extracted every 100ms from a 200ms window frame = SlidingWindow(start=0.0, step=0.100, duration=0.200) # random for illustration purposes data = np.random.randn(100, 4) features = SlidingWindowFeature(data, frame) # ### Cropping # You may use `crop` to extract a temporal subset: # In[4]: help(features.crop) # In[5]: from pyannote.core import Segment features.crop(Segment(2, 3)) # ### Need help? # You can always try the following... # Who knows? It might give you the information you are looking for! # In[6]: help(SlidingWindowFeature)