Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是不是减去了数据集的所有图片的三个通道的均值来为实现归一化做准备? #14

Open
StormArcher opened this issue Sep 28, 2019 · 2 comments

Comments

@StormArcher
Copy link

是不是减去了数据集的所有图片的三个通道的均值来为实现归一化做准备?

in_ -= np.array((104.00699, 116.66877, 122.67892))
另外这个三通道均值是自己计算的吗?还是每个数据集都会提供,我记得minist手写字数据集的视频教程里面都会提到这个减去均值的过程。

@StormArcher
Copy link
Author

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
Copy link
Owner

JXingZhao commented Sep 29, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants