Vishal2188 / TherISuRNet---A-Computationally-Efficient-Thermal-Image-Super-Resolution-Network

Tensorflow implementation of our Paper published in PBVS Workshop 2020 in Conjunction with CVPR 2020.
MIT License
20 stars 5 forks source link

Scale: X2 #2

Closed Moaazallaham closed 3 years ago

Moaazallaham commented 3 years ago

Hello Vishal,

Can you tell me what changes I need to do in order to achieve a scale of 2 or 3 instead of 4?

Thanks in advance.

Vishal2188 commented 3 years ago

Changes you have to make in main.py file: 1) Put the corresponding LR and HR images in train_lr and train_hr folders 2) line number 75 : t = tf.placeholder(tf.float32, [bs, img_size3, img_size3, 3]) 3) line number 149 : X = cv2.resize(X,(img_size23,img_size23),interpolation = cv2.INTER_CUBIC)

Changes you have to make in model.py file: 1) line number 81 : x = tf.depth_to_space(x, 3) 2) line number 95 : x_GRL = tf.image.resize_bicubic(x, size=[h 3, w 3], align_corners=False, name=None) 3) line number 114-115 : xUP = self.Upsample2xBlock(x4, kernel_size=3, filters=6333, strides = 1) 4) Remove line numbers: 129-130 and replace the teminology x6 with x5 in line number 132

Changes you have to make in btgen.py file: 1) line number 17: self.HRSize = (img_size3,img_size3) 2) line number 41: new_y = img_y[y3:y3+self.HRSize[0], x3:x3+self.HRSize[1]]

The same changes for upscaling factor 2; just replace the letter 3 with 2. One additional change you have to make when dealing with upscaling factor 2. However, this change you have to made only when you are using the Domo PBVS training dataset. The change is below:

Line number: 39 - replace this sentence y = np.random.randint(0, h - self.LRSize[0]-1) with y = np.random.randint(0, self.LRSize[0]-1 - h)

This change you have to do because of the image size of the Domo PBVS training dataset. As the size of that dataset is very small so that you have to make the above change.

Moaazallaham commented 3 years ago

Thank you so much for your detailed explanation.

It worked! :)