Closed Ijustakid closed 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]
不过既然都反了,好像也没啥大问题,不过建议最好改一下或者做个注释~
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]