コード例 #1
0
ファイル: sandbox_labels.py プロジェクト: Haotianz94/esper
def handlabeled_commercials():
    from query.models import LabeledCommercial
    from esper.rekall import qs_to_intrvllists, intrvllists_to_result

    commercials = LabeledCommercial.objects \
            .annotate(fps=F('video__fps')) \
            .annotate(min_frame=F('fps') * F('start')) \
            .annotate(max_frame=F('fps') * F('end'))

    return intrvllists_to_result(qs_to_intrvllists(commercials))
コード例 #2
0
ファイル: sandbox_labels.py プロジェクト: Haotianz94/esper
def handlabeled_interviews():
    from query.models import LabeledInterview
    from esper.rekall import qs_to_intrvllists, intrvllists_to_result

    interviews = LabeledInterview.objects \
            .annotate(fps=F('video__fps')) \
            .annotate(min_frame=F('fps') * F('start')) \
            .annotate(max_frame=F('fps') * F('end'))

    return intrvllists_to_result(qs_to_intrvllists(interviews))
コード例 #3
0
ファイル: tvnews.py プロジェクト: DanFu09/esper
def multiple_timelines():
    from query.models import LabeledInterview, LabeledPanel, LabeledCommercial
    from esper.rekall import qs_to_intrvllists, intrvllists_to_result, add_intrvllists_to_result

    interviews = LabeledInterview.objects \
            .annotate(fps=F('video__fps')) \
            .annotate(min_frame=F('fps') * F('start')) \
            .annotate(max_frame=F('fps') * F('end'))
    panels = LabeledPanel.objects \
            .annotate(fps=F('video__fps')) \
            .annotate(min_frame=F('fps') * F('start')) \
            .annotate(max_frame=F('fps') * F('end'))
    commercials = LabeledCommercial.objects \
            .annotate(fps=F('video__fps')) \
            .annotate(min_frame=F('fps') * F('start')) \
            .annotate(max_frame=F('fps') * F('end'))

    result = intrvllists_to_result(qs_to_intrvllists(interviews))
    add_intrvllists_to_result(result, qs_to_intrvllists(panels), color="blue")
    add_intrvllists_to_result(result, qs_to_intrvllists(commercials), color="purple")

    return result