from deoxys.model import load_model, Model import numpy as np import matplotlib.pyplot as plt import h5py deo = load_model( # '../../oxford_perf/logs_db/5e2e2349a356a4893813c8f7/model/model.030.h5') # '../../oxford_perf/log_db_ex2/5e3e87d2b26396ccbca9c3e7/model/model.030.h5') # '../../hn_perf/logs_saved_9epochs/model/model.006.h5') '../../hn_perf/exps/model.014.h5') # '../../mnist/logs/model/model.012.h5') if __name__ == '__main__': deo.model.summary() dr = deo.data_reader imgs = [] targets = [] datagen = dr.val_generator.generate() # datagen.__next__() # datagen.__next__() # x, y = datagen.__next__() indexes = [10, 205, 230, 390, 834] k = 5 for i, (x, y) in enumerate(datagen): for index in indexes: if i == index // 4:
from deoxys.keras import backend as K from deoxys.model import load_model, Model import numpy as np import matplotlib.pyplot as plt import h5py from PIL import Image if __name__ == '__main__': # load model deo = load_model('../../hn_perf/exps/model.014.h5') # get data reader dr = deo.data_reader # get input images, targets, predictions imgs = [] targets = [] datagen = dr.val_generator.generate() indexes = [10, 205, 230, 390, 834] k = len(indexes) for i, (x, y) in enumerate(datagen): for index in indexes: if i == index // 4: imgs.append(x[index % 4]) targets.append(y[index % 4]) if len(imgs) == k: break
from deoxys.model import model_from_full_config, load_model import matplotlib.pyplot as plt if __name__ == '__main__': # model = model_from_full_config('config/2d_unet_CT_W_PET.json') model = load_model('../../hn_perf/2d_unet/model/model.014.h5') # # data handling here # model.predict(data) model.model.summary() res = model.activation_maximization('conv2d_1') plt.imshow(res[0][..., 0], ) plt.show()