JXingZhao / EGNet

EGNet:Edge Guidance Network for Salient Object Detection (ICCV 2019)
315 stars 63 forks source link

这里是为了变成RBG通道顺序吗?  in_ = in_.transpose((2, 0, 1)) #15

Open StormArcher opened 5 years ago

StormArcher commented 5 years ago

cv2的通道是BGR PIL.image是RGB 这里是为了变成RBG通道顺序吗?  in = in.transpose((2, 0, 1))

StormArcher commented 5 years ago

def load_image_test(pah):

todo =>pah(image_root+image_list)// ='./ECSSD/Imgs/1.jpg

if not os.path.exists(pah):
    print('File Not Exists')
im = cv2.imread(pah)
in_ = np.array(im, dtype=np.float32)  #?
im_size = tuple(in_.shape[:2])
# in_ = cv2.resize(in_, (cr_size[1], cr_size[0]), interpolation=cv2.INTER_LINEAR)
# in_ = in_[:,:,::-1] # only if use PIL to load image
in_ -= np.array((104.00699, 116.66877, 122.67892))
in_ = in_.transpose((2, 0, 1))
return in_, im_size

dataset.py 182行

JXingZhao commented 5 years ago

不是啊,是把rbg通道从最后一个维度挪到第一个维度。

发件人:Archerzjc notifications@github.com 发送日期:2019-09-28 22:15:03 收件人:JXingZhao/EGNet EGNet@noreply.github.com 抄送人:Subscribed subscribed@noreply.github.com 主题:Re: [JXingZhao/EGNet] 这里是为了变成RBG通道顺序吗?  in = in.transpose((2, 0, 1)) (#15) def load_image_test(pah):

todo =>pah(image_root+image_list)// ='./ECSSD/Imgs/1.jpg

if not os.path.exists(pah): print('File Not Exists') im = cv2.imread(pah) in_ = np.array(im, dtype=np.float32) #? imsize = tuple(in.shape[:2])

in = cv2.resize(in, (cr_size[1], cr_size[0]), interpolation=cv2.INTER_LINEAR)

in = in[:,:,::-1] # only if use PIL to load image

in -= np.array((104.00699, 116.66877, 122.67892)) in = in.transpose((2, 0, 1)) return in, im_size dataset.py 182行 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.