In [1]:
%pylab inline
from pyannote.core import notebook
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)
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))
Out[5]:
You can always try the following...
Who knows? It might give you the information you are looking for!
In [6]:
help(SlidingWindowFeature)