Video-Summary/docs/plot.py

15 lines
606 B
Python
Raw Normal View History

2020-12-05 19:57:24 +00:00
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
2020-12-22 10:57:02 +00:00
import os
2020-12-05 19:57:24 +00:00
2020-12-22 10:57:02 +00:00
data = pd.read_csv(os.path.join(os.path.dirname(__file__), "bm.csv"))
2020-12-29 13:08:37 +00:00
data = data.drop(columns=['Time in Total'])
data = data.set_index(["ContourExtractor Threads for Avg", "ContourExtractor Threads for comp", "LayerFactory Threads", "Video Buffer Length"])
2020-12-22 10:57:02 +00:00
labels = [f"{row[0]}, {row[1]}, {row[2]}, {row[3]}" for row in data.values]
2020-12-29 13:08:37 +00:00
data[:-12].plot.barh(stacked=True, label=labels)
#data.groupby(["ContourExtractor Threads for Avg"]).plot(kind="barh", stacked=True,label =labels)
plt.xlabel("time in seconds")
plt.show()