Skip to content

Commit 163e7d2

Browse files
committed
better plot
1 parent c51a594 commit 163e7d2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

av1an.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,13 @@ def plot_vmaf(self):
564564
vm = self.d.get('tg_vmaf')
565565
if vm:
566566
plt.hlines(vm, 0, len(x1), colors='red')
567+
plt.hlines(sum(real_y)/len(real_y),0, len(x1), colors='blue')
567568

568569
# Save/close
569-
plt.savefig(self.d.get('input_file').stem)
570+
plt.ylabel('VMAF')
571+
plt.xlabel('Frames')
572+
plt.tight_layout()
573+
plt.savefig(self.d.get('input_file').stem, dpi=600)
570574
plt.close()
571575
except Exception as e:
572576
_, _, exc_tb = sys.exc_info()
@@ -577,6 +581,7 @@ def target_vmaf(self, source, command):
577581
mincq = self.d.get('min_cq')
578582
maxcq = self.d.get('max_cq')
579583
steps = self.d.get('vmaf_steps')
584+
frames = self.frame_probe(source)
580585

581586
# Making 3fps probing file
582587
cq = self.man_cq(command, -1)
@@ -625,8 +630,11 @@ def target_vmaf(self, source, command):
625630

626631
for i in range(int(min(xnew)), int(max(xnew)) + 1, 1):
627632
plt.axvline(i, color='grey', linewidth=0.5)
628-
629-
plt.savefig(probe.stem)
633+
plt.ylabel('vmaf')
634+
plt.xlabel('cq')
635+
plt.title(f'Chunk: {probe.stem}, Frames: {frames}') # Add frame count
636+
plt.tight_layout()
637+
plt.savefig(probe.stem, dpi=300)
630638
plt.close()
631639

632640
return int(tg_cq[0]), f'Target: CQ {int(tg_cq[0])} Vmaf: {round(float(tg_cq[1]), 2)}\n'

0 commit comments

Comments
 (0)