diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index 1c0b9780b68eedd3b2e5c6204b87f28c49fe122e..cabd212632f86451094098745b173e8aef6a1716 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -137,6 +137,20 @@ def upsample(tmp): return tmp +def upsample_nearest(tmp): + bsize = tmp.shape[0] + tmp_2 = tmp[:, slc_y_2, slc_x_2] + up = np.zeros(bsize, t.size, s.size) + for k in range(bsize): + for j in range(t.size/2): + for i in range(s.size/2): + up[k, j, i] = tmp_2[k, j, i] + up[k, j, i+1] = tmp_2[k, j, i] + up[k, j+1, i] = tmp_2[k, j, i] + up[k, j+1, i+1] = tmp_2[k, j, i] + return up + + class SRCNN: def __init__(self):