本文整理汇总了Python中jams.Annotation类的典型用法代码示例。如果您正苦于以下问题:Python Annotation类的具体用法?Python Annotation怎么用?Python Annotation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Annotation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ns_mood_thayer_valid
def test_ns_mood_thayer_valid():
ann = Annotation(namespace='mood_thayer')
ann.append(time=0, duration=1.0, value=[0.3, 2.0])
ann.validate()
示例2: test_ns_tempo_valid
def test_ns_tempo_valid():
ann = Annotation(namespace='tempo')
ann.append(time=0, duration=0, value=1, confidence=0.85)
ann.validate()
示例3: test_ns_time_valid
def test_ns_time_valid():
ann = Annotation(namespace='onset')
for time in np.arange(5.0, 10.0):
ann.append(time=time, duration=0.0, value=None, confidence=None)
ann.validate()
示例4: test_ns_beat_invalid
def test_ns_beat_invalid():
ann = Annotation(namespace='beat')
for time in np.arange(5.0):
ann.append(time=time, duration=0.0, value='foo', confidence=None)
ann.validate()
示例5: test_ns_beat_position_valid
def test_ns_beat_position_valid():
ann = Annotation(namespace='beat_position')
ann.append(time=0, duration=1.0, value=dict(position=1,
measure=1,
num_beats=3,
beat_units=4))
ann.validate()
示例6: __test
def __test(data):
ann = Annotation(namespace='onset')
# Bypass the safety chceks in add_observation
ann.data.loc[0] = {'time': pd.to_timedelta(data['time'], unit='s'),
'duration': pd.to_timedelta(data['duration'],
unit='s'),
'value': None,
'confdence': None}
ann.validate()
示例7: test_ns_pitch_midi_valid
def test_ns_pitch_midi_valid():
ann = Annotation(namespace='pitch_midi')
seq_len = 21 # should be odd
times = np.arange(seq_len)
durations = np.zeros(seq_len)
values = np.linspace(-108., 108, seq_len) # includes 0 (odd symmetric)
confidences = np.linspace(0, 1., seq_len)
confidences[seq_len//2] = None # throw in a None confidence value
for (t, d, v, c) in zip(times, durations, values, confidences):
ann.append(time=t, duration=d, value=v, confidence=c)
ann.validate()
示例8: test_ns_beat_valid
def test_ns_beat_valid():
# A valid example
ann = Annotation(namespace='beat')
for time in np.arange(5.0):
ann.append(time=time, duration=0.0, value=1, confidence=None)
for time in np.arange(5.0, 10.0):
ann.append(time=time, duration=0.0, value=None, confidence=None)
ann.validate()
示例9: __test
def __test(data):
ann = Annotation(namespace='onset')
ann.append(**data)
ann.validate()