How to use the esper.plot_util.plot_stacked_bar_chart function in esper

To help you get started, we’ve selected a few esper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scanner-research / esper-tv / app / esper / identity_clusters.py View on Github external
foxdict = defaultdict(lambda: 0)
    for cluster_id in sorted(clusters):
        face_ids = clusters[cluster_id]
        show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
        for face_id_obj in show_name:
            show = face_id_obj["frame__video__show__canonical_show__name"]
            if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
                cnndict[show] += 1
            elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
                msnbcdict[show] += 1
            else:
                foxdict[show] += 1
    raw_bar_chart['CNN']=cnndict
    raw_bar_chart['MSNBC']=msnbcdict
    raw_bar_chart['FOXNEWS']=foxdict
    plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
    plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
    plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')
github scanner-research / esper-tv / app / esper / identity_clusters.py View on Github external
for cluster_id in sorted(clusters):
        face_ids = clusters[cluster_id]
        show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
        for face_id_obj in show_name:
            show = face_id_obj["frame__video__show__canonical_show__name"]
            if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
                cnndict[show] += 1
            elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
                msnbcdict[show] += 1
            else:
                foxdict[show] += 1
    raw_bar_chart['CNN']=cnndict
    raw_bar_chart['MSNBC']=msnbcdict
    raw_bar_chart['FOXNEWS']=foxdict
    plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
    plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
    plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')
github scanner-research / esper-tv / app / esper / identity_clusters.py View on Github external
face_ids = clusters[cluster_id]
        show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
        for face_id_obj in show_name:
            show = face_id_obj["frame__video__show__canonical_show__name"]
            if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
                cnndict[show] += 1
            elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
                msnbcdict[show] += 1
            else:
                foxdict[show] += 1
    raw_bar_chart['CNN']=cnndict
    raw_bar_chart['MSNBC']=msnbcdict
    raw_bar_chart['FOXNEWS']=foxdict
    plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
    plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
    plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')