Created
April 9, 2014 10:17
-
-
Save hbredin/10251189 to your computer and use it in GitHub Desktop.
PyAnnote 101 > Create new annotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyannote import Annotation, Segment | |
# uri (optional) uniform resource identifier | |
uri = 'GameOfThrones.Season01.Episode01' | |
# modality (optional) | |
modality = 'scene' | |
# | |
a = Annotation(uri=uri, modality=modality) | |
t1 = 10 # 10 seconds from start | |
t2 = 20 # 20 seconds from start | |
s = Segment(start=t1, end=t2) | |
track_id = 1 | |
track_id = a.new_track(s) | |
label = 'A' | |
a[s, track_id] = label | |
print a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment