forked from hack2skill/intel-oneAPI
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathframeCount_vs_time_plot.py
More file actions
30 lines (24 loc) · 926 Bytes
/
frameCount_vs_time_plot.py
File metadata and controls
30 lines (24 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from glob import glob
import matplotlib.pyplot as plt
def extractValuesFromFile(fileName):
file_path = glob(fileName)
# print(file_path)
with open(file_path[0], 'r') as file:
content = file.read()
line = ""
values = []
for char in content:
line = line + char
if char == "\n":
values.append(float(line[5:-1]))
line = ""
return values
without_optimization = extractValuesFromFile("video_without_optimization.txt")
with_optimization = extractValuesFromFile("video_with_optimization.txt")
xAxis = [20*i for i in range(len(with_optimization))]
plt.plot(xAxis, without_optimization, color = "red", label = "without_optimization")
plt.plot(xAxis, with_optimization, color = "green", label = "with_optimization")
plt.xlabel("No of frames")
plt.ylabel("Time taken to infer")
plt.legend()
plt.savefig('video_plot.png')