Dialogue Systems Group, Bielefeld University, Germany
The following shows some of the functionality available in reading and manipulating multimodal corpora of human dialogues. These collections are recordings of humans interacting with each other, and contain information in many forms (audio, video, motion capture, eye tracking, dialogue text transcriptions etc)
from __future__ import division
import tgt
import pandas as pd
from mumodo.mumodo import *
import mumodo.reader as mr
from scipy.signal import medfilt
import math
from sgolayscipyorg import *
from mpl_toolkits.mplot3d import Axes3D
pd.set_option('display.column_space',20)
pd.set_option('display.max_columns',40)
pd.set_option('display.max_rows',400)
path_to_xiofile='example_files/r1_12_15/r1_12_15.xio.gz'
XIO files are (custom) xml files containing "streamed" information, such as motion capture data
f = xiofile(path_to_xiofile, 'r',indexing = False)
opening compressed file ... opening file without indexing
Our package (mumodo) can import information from this file directly into a Pandas DataFrame,
facelab = pd.DataFrame(quantize(f.xioquicklinegen(0,0,True),"FaceLabNode")) # Head, eye, and gaze tracking from seeingmachines FaceLab
kinect = pd.DataFrame(quantize(f.xioquicklinegen(0,0,True),"irioKinect")) # motion capture from Microsoft Kinect
#facelab.to_csv("/Users/spyroskousidis/Desktop/facelab.csv")
#kinect.to_csv("/Users/spyroskousidis/Desktop/kinect.csv")
#facelab = pd.DataFrame.from_csv("/Users/spyroskousidis/Desktop/facelab.csv")
#kinect = pd.DataFrame.from_csv("/Users/spyroskousidis/Desktop/kinect.csv")
Our motion capture data looks like this. 3D coordinates of points that represents joints of the human body
kinect[0:1]
AnkleLeft | AnkleRight | ElbowLeft | ElbowRight | FootLeft | FootRight | HandLeft | HandRight | Head | HipCenter | HipLeft | HipRight | KneeLeft | KneeRight | ShoulderCenter | ShoulderLeft | ShoulderRight | Spine | WristLeft | WristRight | framenumber | head | movementInteractionSpace | numberOfSkeletons | numberOfUser | percentageInteractionSpace | soundAngle | time | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | (0.1944391, -0.6452984, 2.209085) | (0.2630651, -0.6710057, 2.049078) | (0.1188137, -0.3061718, 2.527821) | (0.6554346, -0.3386872, 2.479949) | (0.1607874, -0.6638765, 2.104663) | (0.190787, -0.6859288, 1.965804) | (0.1989696, -0.05731615, 2.420833) | (0.6164553, -0.03618268, 2.356531) | (0.4163409, 0.1421598, 2.708142) | (0.3579315, -0.4704616, 2.421389) | (0.2617216, -0.5265177, 2.417922) | (0.4388126, -0.5351951, 2.33248) | (0.3485837, -0.3928925, 2.062126) | (0.3841549, -0.3296755, 2.01984) | (0.4150751, -0.05050764, 2.7372) | (0.2609618, -0.1627192, 2.643351) | (0.5775776, -0.1640097, 2.601623) | (0.3712317, -0.4264579, 2.504515) | (0.1481225, -0.142926, 2.459345) | (0.5743065, -0.1913796, 2.418741) | 46286 | (0.4163409, 0.1421598, 2.708142) | 0 | 1 | 1 | 0 | 0.275071 | 1341393414830 |
Using the timestamp column (not shown) as an index makes finding relevant information in other media (e.g. video) much easier. NOTE: we subtract an offset, so that we have "relative times"
kinect.index = kinect['time'] - 1341393414830
show 100ms data at time 60000 (1 minute mark)
kinect.ix[60000:60100]
AnkleLeft | AnkleRight | ElbowLeft | ElbowRight | FootLeft | FootRight | HandLeft | HandRight | Head | HipCenter | HipLeft | HipRight | KneeLeft | KneeRight | ShoulderCenter | ShoulderLeft | ShoulderRight | Spine | WristLeft | WristRight | framenumber | head | movementInteractionSpace | numberOfSkeletons | numberOfUser | percentageInteractionSpace | soundAngle | time | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
time | ||||||||||||||||||||||||||||
60010 | (0.0858579, -0.788939, 2.338582) | (0.2963392, -0.6750031, 2.040222) | (0.1893704, -0.3735558, 2.521071) | (0.6466523, -0.3542425, 2.484159) | (0.08078306, -0.7678208, 2.228952) | (0.2174373, -0.6772759, 1.961103) | (0.1143858, -0.5451745, 2.280536) | (0.613691, -0.5857276, 2.311626) | (0.4363124, 0.1439961, 2.719968) | (0.3587632, -0.4502191, 2.374635) | (0.2799292, -0.4978054, 2.345621) | (0.4207565, -0.5055265, 2.321554) | (0.09219158, -0.6090243, 2.298598) | (0.3740755, -0.3016991, 2.004356) | (0.4201493, -0.03171659, 2.711645) | (0.2647097, -0.1710935, 2.623442) | (0.5551695, -0.1767071, 2.57503) | (0.3743551, -0.4090749, 2.461244) | (0.1079715, -0.5249954, 2.342776) | (0.6219314, -0.5278563, 2.351771) | 48084 | (0.4363124, 0.1439961, 2.719968) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474840 |
60022 | (0.08848099, -0.785784, 2.336404) | (0.2868146, -0.6239264, 1.940589) | (0.1921079, -0.3673297, 2.521032) | (0.6464437, -0.3522286, 2.484285) | (0.0828887, -0.7652678, 2.226685) | (0.1937447, -0.6475704, 1.883411) | (0.1165956, -0.5421768, 2.283758) | (0.6134197, -0.5826323, 2.311934) | (0.4355942, 0.1439556, 2.719006) | (0.357938, -0.4503873, 2.373739) | (0.2793624, -0.4987493, 2.34517) | (0.4186242, -0.5044063, 2.316769) | (0.09273398, -0.6094134, 2.296946) | (0.3747576, -0.297025, 2.001555) | (0.4199454, -0.03333472, 2.710862) | (0.2646232, -0.1800482, 2.617211) | (0.5564743, -0.1773879, 2.572571) | (0.3739759, -0.4094839, 2.460415) | (0.1101813, -0.5219977, 2.345998) | (0.6216757, -0.5250314, 2.3520331) | 48085 | (0.4355942, 0.1439556, 2.719006) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474852 |
60032 | (0.08848099, -0.785784, 2.336404) | (0.2868146, -0.6239264, 1.940589) | (0.1921079, -0.3673297, 2.521032) | (0.6464437, -0.3522286, 2.484285) | (0.0828887, -0.7652678, 2.226685) | (0.1937447, -0.6475704, 1.883411) | (0.1165956, -0.5421768, 2.283758) | (0.6134197, -0.5826323, 2.311934) | (0.4355942, 0.1439556, 2.719006) | (0.357938, -0.4503873, 2.373739) | (0.2793624, -0.4987493, 2.34517) | (0.4186242, -0.5044063, 2.316769) | (0.09273398, -0.6094134, 2.296946) | (0.3747576, -0.297025, 2.001555) | (0.4199454, -0.03333472, 2.710862) | (0.2646232, -0.1800482, 2.617211) | (0.5564743, -0.1773879, 2.572571) | (0.3739759, -0.4094839, 2.460415) | (0.1101813, -0.5219977, 2.345998) | (0.6216757, -0.5250314, 2.3520331) | 48085 | (0.4355942, 0.1439556, 2.719006) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474862 |
60042 | (0.08848099, -0.785784, 2.336404) | (0.2868146, -0.6239264, 1.940589) | (0.1921079, -0.3673297, 2.521032) | (0.6464437, -0.3522286, 2.484285) | (0.0828887, -0.7652678, 2.226685) | (0.1937447, -0.6475704, 1.883411) | (0.1165956, -0.5421768, 2.283758) | (0.6134197, -0.5826323, 2.311934) | (0.4355942, 0.1439556, 2.719006) | (0.357938, -0.4503873, 2.373739) | (0.2793624, -0.4987493, 2.34517) | (0.4186242, -0.5044063, 2.316769) | (0.09273398, -0.6094134, 2.296946) | (0.3747576, -0.297025, 2.001555) | (0.4199454, -0.03333472, 2.710862) | (0.2646232, -0.1800482, 2.617211) | (0.5564743, -0.1773879, 2.572571) | (0.3739759, -0.4094839, 2.460415) | (0.1101813, -0.5219977, 2.345998) | (0.6216757, -0.5250314, 2.3520331) | 48085 | (0.4355942, 0.1439556, 2.719006) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474872 |
60058 | (0.08848099, -0.785784, 2.336404) | (0.2868146, -0.6239264, 1.940589) | (0.1921079, -0.3673297, 2.521032) | (0.6464437, -0.3522286, 2.484285) | (0.0828887, -0.7652678, 2.226685) | (0.1937447, -0.6475704, 1.883411) | (0.1165956, -0.5421768, 2.283758) | (0.6134197, -0.5826323, 2.311934) | (0.4355942, 0.1439556, 2.719006) | (0.357938, -0.4503873, 2.373739) | (0.2793624, -0.4987493, 2.34517) | (0.4186242, -0.5044063, 2.316769) | (0.09273398, -0.6094134, 2.296946) | (0.3747576, -0.297025, 2.001555) | (0.4199454, -0.03333472, 2.710862) | (0.2646232, -0.1800482, 2.617211) | (0.5564743, -0.1773879, 2.572571) | (0.3739759, -0.4094839, 2.460415) | (0.1101813, -0.5219977, 2.345998) | (0.6216757, -0.5250314, 2.3520331) | 48085 | (0.4355942, 0.1439556, 2.719006) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474888 |
60064 | (0.08848099, -0.785784, 2.336404) | (0.2868146, -0.6239264, 1.940589) | (0.1921079, -0.3673297, 2.521032) | (0.6464437, -0.3522286, 2.484285) | (0.0828887, -0.7652678, 2.226685) | (0.1937447, -0.6475704, 1.883411) | (0.1165956, -0.5421768, 2.283758) | (0.6134197, -0.5826323, 2.311934) | (0.4355942, 0.1439556, 2.719006) | (0.357938, -0.4503873, 2.373739) | (0.2793624, -0.4987493, 2.34517) | (0.4186242, -0.5044063, 2.316769) | (0.09273398, -0.6094134, 2.296946) | (0.3747576, -0.297025, 2.001555) | (0.4199454, -0.03333472, 2.710862) | (0.2646232, -0.1800482, 2.617211) | (0.5564743, -0.1773879, 2.572571) | (0.3739759, -0.4094839, 2.460415) | (0.1101813, -0.5219977, 2.345998) | (0.6216757, -0.5250314, 2.3520331) | 48085 | (0.4355942, 0.1439556, 2.719006) | 0 | 1 | 1 | 0 | 0.276037 | 1341393474894 |
60074 | (0.08933435, -0.7832304, 2.335191) | (0.2914991, -0.6186011, 1.935087) | (0.1901498, -0.3646719, 2.525378) | (0.6450949, -0.3509136, 2.483969) | (0.08361663, -0.763276, 2.225376) | (0.1976273, -0.6444933, 1.880242) | (0.1223157, -0.5310674, 2.277009) | (0.5595263, -0.5677146, 2.254264) | (0.4342428, 0.144289, 2.718987) | (0.3578076, -0.4514132, 2.367288) | (0.2865768, -0.5001489, 2.335523) | (0.4124326, -0.5051705, 2.308227) | (0.0939874, -0.64309, 2.26379) | (0.3734146, -0.2903203, 1.997585) | (0.4204573, -0.03404647, 2.709956) | (0.2628811, -0.1819311, 2.617732) | (0.5547284, -0.1806263, 2.565007) | (0.3746701, -0.4107355, 2.455205) | (0.1159014, -0.5108885, 2.339249) | (0.5809184, -0.5135144, 2.308702) | 48086 | (0.4342428, 0.144289, 2.718987) | 0 | 1 | 1 | 0 | 0.273665 | 1341393474904 |
60085 | (0.08933435, -0.7832304, 2.335191) | (0.2914991, -0.6186011, 1.935087) | (0.1901498, -0.3646719, 2.525378) | (0.6450949, -0.3509136, 2.483969) | (0.08361663, -0.763276, 2.225376) | (0.1976273, -0.6444933, 1.880242) | (0.1223157, -0.5310674, 2.277009) | (0.5595263, -0.5677146, 2.254264) | (0.4342428, 0.144289, 2.718987) | (0.3578076, -0.4514132, 2.367288) | (0.2865768, -0.5001489, 2.335523) | (0.4124326, -0.5051705, 2.308227) | (0.0939874, -0.64309, 2.26379) | (0.3734146, -0.2903203, 1.997585) | (0.4204573, -0.03404647, 2.709956) | (0.2628811, -0.1819311, 2.617732) | (0.5547284, -0.1806263, 2.565007) | (0.3746701, -0.4107355, 2.455205) | (0.1159014, -0.5108885, 2.339249) | (0.5809184, -0.5135144, 2.308702) | 48086 | (0.4342428, 0.144289, 2.718987) | 0 | 1 | 1 | 0 | 0.273665 | 1341393474915 |
60096 | (0.08933435, -0.7832304, 2.335191) | (0.2914991, -0.6186011, 1.935087) | (0.1901498, -0.3646719, 2.525378) | (0.6450949, -0.3509136, 2.483969) | (0.08361663, -0.763276, 2.225376) | (0.1976273, -0.6444933, 1.880242) | (0.1223157, -0.5310674, 2.277009) | (0.5595263, -0.5677146, 2.254264) | (0.4342428, 0.144289, 2.718987) | (0.3578076, -0.4514132, 2.367288) | (0.2865768, -0.5001489, 2.335523) | (0.4124326, -0.5051705, 2.308227) | (0.0939874, -0.64309, 2.26379) | (0.3734146, -0.2903203, 1.997585) | (0.4204573, -0.03404647, 2.709956) | (0.2628811, -0.1819311, 2.617732) | (0.5547284, -0.1806263, 2.565007) | (0.3746701, -0.4107355, 2.455205) | (0.1159014, -0.5108885, 2.339249) | (0.5809184, -0.5135144, 2.308702) | 48086 | (0.4342428, 0.144289, 2.718987) | 0 | 1 | 1 | 0 | 0.273665 | 1341393474926 |
We can slice the columns that we are interested in (e.g. upper body)
skeletonframe = kinect.ix[:,['ElbowLeft', 'ElbowRight','HandLeft', 'HandRight', 'Head', 'ShoulderCenter','ShoulderLeft', 'ShoulderRight','WristLeft', 'WristRight']]
skeletonframe.ix[65000:65010]
ElbowLeft | ElbowRight | HandLeft | HandRight | Head | ShoulderCenter | ShoulderLeft | ShoulderRight | WristLeft | WristRight | |
---|---|---|---|---|---|---|---|---|---|---|
time | ||||||||||
65008 | (0.1950761, -0.3459699, 2.468652) | (0.6501585, -0.3502173, 2.48801) | (0.1160009, -0.3562476, 2.257447) | (0.6254832, -0.6064282, 2.332561) | (0.4301711, 0.1360443, 2.673841) | (0.4266743, -0.06476441, 2.703737) | (0.2599969, -0.1722962, 2.643432) | (0.5743487, -0.1751465, 2.609853) | (0.140087, -0.3663526, 2.262653) | (0.6282281, -0.5202434, 2.354419) |
Custom classes allow extracting information down to specific coordinates
point = skeletonframe['Head'].ix[65008]
print point.v # as vector
print point.x #a specific coordinate
[0.4301711, 0.1360443, 2.673841] 0.4301711
Plot one coordinate
plot(list(skeletonframe['Head'][0:100].map(lambda x: x.x)))
[<matplotlib.lines.Line2D at 0x95c8050>]
Draw entire upper body at a time
frame_time = 65019
fig = figure(figsize=(8,8))
ax = fig.add_subplot(111, projection='3d')
xs ,ys, zs = [], [], []
for joint in skeletonframe.columns:
xs.append(skeletonframe[joint].ix[frame_time].x)
ys.append(skeletonframe[joint].ix[frame_time].y)
zs.append(skeletonframe[joint].ix[frame_time].z)
ax.scatter(xs, ys, zs, s=150,c='b')
#draw lines between points
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
<matplotlib.text.Text at 0xf9c7f90>
draw any number of joints during a time range. Time coded by transparency
start_time = 62000
end_time = 63000
fig = figure(figsize = (10,8))
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
for frame_time in skeletonframe.ix[start_time:end_time].index:
xs,ys, zs = [], [], []
for joint in ['HandLeft', 'HandRight']:
try:
xs.append(skeletonframe[joint].ix[frame_time].x)
ys.append(skeletonframe[joint].ix[frame_time].y)
zs.append(skeletonframe[joint].ix[frame_time].z)
a = (frame_time - start_time)/ (end_time-start_time)
#cs = cmap((frame_time - start_time)/ (end_time-start_time))
except AttributeError:
pass
ax.scatter(xs, ys, zs, s= 50, c = ['r','b'], alpha = a)
Track one joint with color-coded time. Colorbar timestamp legend
start_time = 62500
end_time = 64000
joint = 'Head'
fig = figure(figsize = (10,8))
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
xs,ys, zs, cs = [], [], [], []
for frame_time in skeletonframe.ix[start_time:end_time].index:
try:
xs.append(skeletonframe[joint].ix[frame_time].x)
ys.append(skeletonframe[joint].ix[frame_time].y)
zs.append(skeletonframe[joint].ix[frame_time].z)
#cs.append((frame_time - start_time)/ (end_time-start_time))
cs.append(frame_time)
except AttributeError:
pass
cax = ax.scatter(xs, ys, zs, zdir = 'z', s= 50, c = cs, cmap = cm.jet)
fig.colorbar(cax)
<matplotlib.colorbar.Colorbar instance at 0xd1a4418>
Import a textgrid (annotation file)
myannotations = pd.Panel(mr.Textgrid_to_Pandas("example_files/GEO-TXT-LI-00001-72_ch1.TextGrid"))
myannotations #show the tiers
<class 'pandas.core.panel.Panel'> Dimensions: 1 (items) x 98 (major_axis) x 3 (minor_axis) Items axis: silences to silences Major_axis axis: 0 to 97 Minor_axis axis: start_time to text
Tiers are refered to by name
mytier = myannotations['silences']
Plot a part of this annoation tier. NOTE: this is a tier with information on turn-taking in dialogue
fig=figure(figsize = (24,2))
colormap = { 'p' : 'white', 'o' : 'red', 's1' : 'blue', 's2' : 'green','n': 'black'}
ax1 = subplot2grid((1,7), (0,0), colspan=5)
ax1.set_xlabel('time(s)',fontsize = 15)
for i in mytier[0:20].index:
try:
ax1.axvspan(mytier['start_time'][i], mytier['end_time'][i], facecolor = colormap[mytier['text'][i]])
except KeyError:
ax1.axvspan(mytier['start_time'][i], mytier['end_time'][i], facecolor = colormap['n'])
ax2 = subplot2grid((1,7), (0,6))
ax2.pos = arange(5)+.1 # the bar centers on the y axis
ax2.barh(ax2.pos, [50*x for x in np.ones(5)], align='center',height=0.5, color = (colormap['p'], colormap['o'], colormap['s1'], colormap['s2'], colormap['n']))
ax2.get_xaxis().set_visible(False)
ax2.set_yticks(range(5))
ax2.set_xticks(range(100))
ax2.set_yticklabels(('silence', 'overlap', 'speaker1', 'speaker2' , 'non-speech'), fontsize = 15)
[<matplotlib.text.Text at 0x1017a8f0>, <matplotlib.text.Text at 0x10165cf0>, <matplotlib.text.Text at 0x1023f170>, <matplotlib.text.Text at 0x10189db0>, <matplotlib.text.Text at 0x10206d30>]
myannotations = pd.Panel(mr.Textgrid_to_Pandas("example_files/r1-20120704-cam1-head-sk.TextGrid"))
myannotations #show the tiers
<class 'pandas.core.panel.Panel'> Dimensions: 1 (items) x 317 (major_axis) x 3 (minor_axis) Items axis: HeadSK to HeadSK Major_axis axis: 0 to 316 Minor_axis axis: start_time to text
mytier = myannotations['HeadSK']
Drop empty intervals
mytier = mytier[mytier['text']>'']
mytier[20:30]
start_time | end_time | text | |
---|---|---|---|
41 | 691.912 | 692.345 | tilt-left |
43 | 698.083 | 698.44 | turn-aw |
45 | 702.094 | 703.952 | nod/turn-tw-nod-2 |
47 | 722.76 | 724.273 | jerk-nod/tilt-left-nod |
49 | 726.879 | 727.69 | nod-2 |
51 | 730.849 | 732.19 | nod-turn-aw/nod-turn-tw/nod-nod |
53 | 733.501 | 733.881 | nod |
55 | 734.173 | 735.892 | nod-2-nod/turn-aw-nod/turn-tw-nod |
57 | 737.061 | 738.476 | nod-4 |
59 | 739.421 | 739.773 | turn-aw |
Facelab has an inherent lag due to tracking filters. Luckily, we have access to the time of capture through its data stream
f = facelab.dropna()
f['time_real'] = 1000 * f['frameTimeSeconds'] + f['frameTimeMilliSeconds']
Plot the lag
plot(f.index,f['time']-f['time_real'])
print np.mean(f['time']-f['time_real'])
8.44551132656
We see than the mean lag is 8 ms, maximum 60ms. Re-sync this input and use its time as index. Again, subtract the first timestamp to get relative times
f.drop_duplicates(cols=['time_real'])
f.index = f['time_real'].map(lambda x: int(x) - 1341393414826 )
f = f.sort_index()
f.ix[0:10]
frameTimeMilliSeconds | frameTimeSeconds | gazeCalibrated | gazeQualityLevelLeft | gazeQualityLevelRight | gazedObject | headPosition | headPositionConfidence | headRotation | headTrackerState | intersectedObjects | leftEyePosition | leftEyeRotation | leftHeadEyePosition | leftPupilDiameter | leftPupilPosition | modelQualityLevel | rightEyePosition | rightEyeRotation | rightHeadEyePosition | rightPupilDiameter | rightPupilPosition | saccade | time | unifiedEyePosition | unifiedEyeRotation | time_real | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
time_real | |||||||||||||||||||||||||||
0 | 826 | 1341393414 | True | 1 | 1 | no object | (-0.058545634, 0.27584514, 0.8703899) | 0.260222 | (-0.17656305, -0.24282584, 0.09397778, 0.9492256) | True | no object | (-0.04119049, 0.288193, 0.89226663) | (-0.14100225, -0.26506087, -0.03921493, 0.95306) | (-0.08805588, 0.27013108, 0.86602736) | 0 | (0.0, 0.0, 0.0) | 100 | (-0.08805588, 0.27013108, 0.8660274) | (-0.14100225, -0.26506087, -0.03921493, 0.95306) | (-0.04119049, 0.288193, 0.89226663) | 0 | (0.0, 0.0, 0.0) | True | 1341393414837 | (-0.058545634, 0.27584514, 0.8703899) | (-0.14100225, -0.26506087, -0.03921493, 0.95306) | 1.341393e+12 |
Rotations (e.g. of the head or the gaze vectors) are defined as quaternions. Our custom classes do all the standard convertions
print "quaternion:", f['headRotation'][0].v #as vector
print "Pitch (or bank):",f['headRotation'][0].bank #Bank or pitch Euler angle
print "Yaw (or heading):",f['headRotation'][0].heading #Yaw or heading Euler angle
print "Roll (or attitude):" ,f['headRotation'][0].attitude #Roll or attitude Euler angle
quaternion: [-0.17656305, -0.24282584, 0.09397778, 0.9492256] Pitch (or bank): -0.304923353318 Yaw (or heading): -0.45957017273 Roll (or attitude): 0.267333276796
Columns can be easily created (and deleted) e.g.
f["bank"] = f["headRotation"].map(lambda x: x.bank)
f['bank'].index
Int64Index([0, 17, 34, ..., 179931, 179948, 179965], dtype=int64)
#plot_gesture
axisID = "bank"
start = 13500
end = 13800
data = []
for x in f.ix[start:end][axisID]:
data.append(x)
print len(data),start,end
y = savitzky_golay(data, window_size = 7, order = 3, deriv =0)
dy = savitzky_golay(data, window_size =7, order = 3, deriv =1)
subplot(211)
plot(f.ix[start:end].index,data,'b',f.ix[start:end].index,y,'r')
subplot(212)
plot(f.ix[start:end].index,dy)
18 13500 13800
[<matplotlib.lines.Line2D at 0x106fa370>]
This is a transcription tier.
myannotations = pd.Panel(mr.Textgrid_to_Pandas("example_files/r1_12_15/r1215en.TextGrid"))
myannotations
<class 'pandas.core.panel.Panel'> Dimensions: 1 (items) x 99 (major_axis) x 3 (minor_axis) Items axis: A (en) to A (en) Major_axis axis: 0 to 98 Minor_axis axis: start_time to text
mytier = myannotations['A (en)']
mytier
start_time | end_time | text | |
---|---|---|---|
0 | 0 | 2.80482 | |
1 | 2.80482 | 3.471348 | I see yes |
2 | 3.471348 | 3.722378 | |
3 | 3.722378 | 3.87819 | yes |
4 | 3.87819 | 6.909525 | |
5 | 6.909525 | 7.316367 | yes |
6 | 7.316367 | 7.402929 | |
7 | 7.402929 | 7.593366 | yes |
8 | 7.593366 | 10.87407 | |
9 | 10.87407 | 11.64447 | yes I think I |
10 | 11.64447 | 13.10737 | |
11 | 13.10737 | 15.03937 | there a room there there and then there yes |
12 | 15.03937 | 15.37696 | |
13 | 15.37696 | 15.55874 | yes |
14 | 15.55874 | 17.06492 | |
15 | 17.06492 | 17.31595 | yes |
16 | 17.31595 | 17.44579 | |
17 | 17.44579 | 17.67951 | sure |
18 | 17.67951 | 19.49732 | |
19 | 19.49732 | 19.70507 | yes |
20 | 19.70507 | 25.2467 | |
21 | 25.2467 | 27.84356 | so I would already gladly a large room have |
22 | 27.84356 | 28.98618 | |
23 | 28.98618 | 29.21125 | yes |
24 | 29.21125 | 29.45362 | |
25 | 29.45362 | 29.74793 | yes |
26 | 29.74793 | 30.01794 | |
27 | 30.01794 | 30.26031 | yes yes |
28 | 30.26031 | 30.47671 | |
29 | 30.47671 | 32.49361 | (then have we five +) . then have we fifty mea... |
30 | 32.49361 | 35.16838 | |
31 | 35.16838 | 36.31966 | puh |
32 | 36.31966 | 37.06409 | |
33 | 37.06409 | 37.57481 | yes |
34 | 37.57481 | 38.31225 | |
35 | 38.31225 | 39.26443 | also twentyfive |
36 | 39.26443 | 45.62674 | |
37 | 45.62674 | 45.97299 | yes |
38 | 45.97299 | 46.09584 | |
39 | 46.09584 | 46.243 | yes |
40 | 46.243 | 46.31225 | |
41 | 46.31225 | 46.5979 | yes |
42 | 46.5979 | 47.16056 | |
43 | 47.16056 | 47.37696 | yes |
44 | 47.37696 | 48.28586 | |
45 | 48.28586 | 51.86088 | okay then need we still ... bathroom can we . ... |
46 | 51.86088 | 56.29452 | |
47 | 56.29452 | 60.32831 | <laughter/> |
48 | 60.32831 | 66.1556 | |
49 | 66.1556 | 72.68405 | <laughter> so mean you that is penalty enough ... |
50 | 72.68405 | 74.11232 | |
51 | 74.11232 | 76.1725 | so we were now (gr +) at how many squarem |
52 | 76.1725 | 76.91693 | eighty exactly |
53 | 76.91693 | 77.75825 | |
54 | 77.75825 | 79.33368 | then need we so good then |
55 | 79.33368 | 85.38437 | |
56 | 85.38437 | 85.85181 | yes |
57 | 85.85181 | 86.21703 | |
58 | 86.21703 | 89.87861 | yes yes but that would be then yeah . yeah suc... |
59 | 89.87861 | 98.44992 | |
60 | 98.44992 | 98.65766 | <laughter/> |
61 | 98.65766 | 99.757 | |
62 | 99.757 | 100.6053 | yes yes yes yes |
63 | 100.6053 | 100.9689 | okay |
64 | 100.9689 | 101.5592 | |
65 | 101.5592 | 104.2945 | say we ... fourty square meter that . liv |
66 | 104.2945 | 105.4025 | |
67 | 105.4025 | 106.7442 | nope we had just eighty |
68 | 106.7442 | 129.8613 | |
69 | 129.8613 | 130.8048 | yes eh eh yes |
70 | 130.8048 | 133.8708 | |
71 | 133.8708 | 134.2517 | good where |
72 | 134.2517 | 134.6066 | |
73 | 134.6066 | 134.9528 | yes |
74 | 134.9528 | 135.9223 | |
75 | 135.9223 | 137.567 | (two +) two times twentyfive |
76 | 137.567 | 138.4845 | |
77 | 138.4845 | 139.0905 | and then |
78 | 139.0905 | 142.6325 | |
79 | 142.6325 | 143.0221 | exactly |
80 | 143.0221 | 145.3939 | |
81 | 145.3939 | 146.0084 | god yes |
82 | 146.0084 | 146.2595 | |
83 | 146.2595 | 149.9141 | <laughter> so many space </laughter> |
84 | 149.9141 | 150.1911 | |
85 | 150.1911 | 150.8316 | eh yes |
86 | 150.8316 | 155.2376 | |
87 | 155.2376 | 155.9128 | a dress |
88 | 155.9128 | 157.8085 | |
89 | 157.8085 | 158.269 | nope |
90 | 158.269 | 158.7797 | |
91 | 158.7797 | 159.8098 | nope that need we not |
92 | 159.8098 | 165.94 | |
93 | 165.94 | 168.7533 | <laughter/> |
94 | 168.7533 | 174.5287 | |
95 | 174.5287 | 178.2941 | huh we have still our rooms ea so corridor is ... |
96 | 178.2941 | 178.4153 | |
97 | 178.4153 | 179.4713 | how want you there another |
98 | 179.4713 | 180 |
start_time | end_time | text | |
---|---|---|---|
0 | 0 | 180 |
fig = figure(figsize