hellloxiaotian / ADNet

Attention-guided CNN for image denoising(Neural Networks,2020)
https://doi.org/10.1016/j.neunet.2019.12.024
117 stars 5 forks source link

Im2Patch的endw和endh弄反了... #20

Closed Ijustakid closed 3 years ago

Ijustakid commented 3 years ago

prepare_data中 img = cv2.imread(files[i]) 读图进来是[HWC]

经过 Img = Img.permute(2,0,1) 后是[CHW]

Im2Patch生成patch中 endc = img.shape[0] # img channels endw = img.shape[1] # img width endh = img.shape[2] # img height 把 img.shape[1]当做了W, img.shape[2]当做了H,这是不是写反了?

应该 endc = img.shape[0] endh = img.shape[1] endw = img.shape[2]

Ijustakid commented 3 years ago

prepare_data中 img = cv2.imread(files[i]) 读图进来是[HWC]

经过 Img = Img.permute(2,0,1) 后是[CHW]

Im2Patch生成patch中 endc = img.shape[0] # img channels endw = img.shape[1] # img width endh = img.shape[2] # img height 把 img.shape[1]当做了W, img.shape[2]当做了H,这是不是写反了?

应该 endc = img.shape[0] endh = img.shape[1] endw = img.shape[2]

同时,这个也写反了 patch = img[:, 0:endw-win+0+1:stride, 0:endh-win+0+1:stride] 应该是 patch = img[:, 0:endh-win+0+1:stride, 0:endw-win+0+1:stride]

不过既然都反了,好像也没啥大问题,不过建议最好改一下或者做个注释~