-
Notifications
You must be signed in to change notification settings - Fork 0
/
summarize.py
executable file
·36 lines (23 loc) · 972 Bytes
/
summarize.py
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
31
32
33
34
35
#!/usr/bin/env python3
import json
import os
d = json.loads(open('settings.json', 'r').read())
experiment_time = d['experiment_time']
settings = d['settings']
for setting in settings:
quantizer = setting['quantizer']
delay = setting['delay']
pathname = 'q{}-d{}'.format(quantizer, delay)
with open(os.path.join(pathname, 'ssim1.log'), 'r') as f:
last_line = f.read().strip().split('\n')[-1]
y_ssim = float(last_line.split("Y': ")[-1].split(' ')[0])
print(','.join(map(str,[delay, quantizer, y_ssim])))
print('')
for setting in settings:
quantizer = setting['quantizer']
delay = setting['delay']
pathname = 'q{}-d{}'.format(quantizer, delay)
with open(os.path.join(pathname, 'ssim2.log'), 'r') as f:
last_line = f.read().strip().split('\n')[-1]
y_ssim = float(last_line.split("Y': ")[-1].split(' ')[0])
print(','.join(map(str,[delay, quantizer, y_ssim])))