本文整理汇总了Python中jams.Annotation.validate方法的典型用法代码示例。如果您正苦于以下问题:Python Annotation.validate方法的具体用法?Python Annotation.validate怎么用?Python Annotation.validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jams.Annotation
的用法示例。
在下文中一共展示了Annotation.validate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ns_tempo_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
def test_ns_tempo_valid():
ann = Annotation(namespace='tempo')
ann.append(time=0, duration=0, value=1, confidence=0.85)
ann.validate()
示例2: test_ns_mood_thayer_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例3: __test
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
def __test(pattern):
ann = Annotation(namespace='pattern_jku')
ann.append(time=0, duration=1.0, value=pattern)
ann.append(time=1.0, duration=1.0, value=pattern)
ann.validate()
示例4: test_ns_time_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例5: test_ns_beat_invalid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例6: test_ns_beat_position_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例7: test_ns_beat_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例8: test_ns_pitch_midi_valid
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
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()
示例9: __test
# 需要导入模块: from jams import Annotation [as 别名]
# 或者: from jams.Annotation import validate [as 别名]
def __test(data):
ann = Annotation(namespace='onset')
ann.append(**data)
ann.validate()