In [98]:
# notes of GroundTruthPlotter#even_segments
warnings.filterwarnings('ignore')

from lib.exp.evaluator.ground_truth import GroundTruth as GT
from lib.plotter.ground_truth_plotter import GroundTruthPlotter as GTP
root = 'univ_07'; name='coates'
gt = GT(root, name)
slip = gt.common_path(resource='slides', ext=None, asure=False)

In [99]:
### Get needed segments
df = gt.univ_df()
dsg = gt.segments(df[df.sid > 0])
print dsg


[[4289, 278, 1], [4750, 2, 1], [4768, 514, 2], [5286, 704, 3], [5996, 480, 4], [6590, 424, 5], [7044, 840, 6], [7908, 660, 7], [8736, 360, 7], [9160, 344, 8], [9520, 650, 9], [10398, 210, 10], [10636, 594, 11], [11608, 390, 11], [12214, 150, 11], [12732, 210, 12], [12974, 750, 12], [14002, 570, 13], [14934, 1410, 14], [16374, 1010, 15], [17876, 180, 16], [18392, 510, 16], [18932, 692, 17], [19940, 510, 17], [20972, 1068, 18], [22516, 720, 19], [23540, 0, 19], [23570, 1118, 20], [24942, 870, 21], [26054, 1252, 22], [28016, 330, 22], [28552, 420, 23], [30090, 360, 24], [30758, 870, 24], [31942, 732, 25], [33500, 30, 25], [33546, 1634, 26], [35498, 1190, 27], [38010, 1264, 28], [39304, 862, 29], [40372, 1140, 30], [41702, 660, 31], [42786, 1146, 31], [44648, 676, 32], [45568, 1046, 33], [46902, 570, 33], [47492, 840, 34], [48860, 330, 34], [49716, 870, 35], [50794, 1564, 36], [52388, 858, 37], [53276, 1020, 38], [54518, 510, 39], [55058, 630, 40], [55694, 642, 41], [57656, 60, 41], [57746, 912, 42], [59872, 150, 42], [60520, 1440, 43], [61984, 1020, 44], [63272, 720, 45], [64022, 660, 46], [64712, 510, 47], [65834, 570, 48], [69818, 540, 48], [69818, 540, 48]]

In [100]:
# plot it
gtp = GTP()
gtp.img_base = slip + "/mid"
fig = plt.figure(figsize=(18, 10))
gtp.even_segments(fig, dsg)
plt.show()