File size: 461 Bytes
d491737
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import json
import numpy as np
from utils.isoutil import *
import sys


def load_params(config_file):
    with open(config_file, 'r') as f:
        data = json.load(f)
    return data

def imshow(img):
    npimg = img.numpy()
    plt.figure(figsize = (30,30))
    plt.imshow(np.transpose(npimg, (1, 2, 0)))
    plt.axis('off')
    plt.show()


def write(text):
    sys.stdout.write('\n' + text)
    if hasattr(sys.stdout, 'flush'):
        sys.stdout.flush()