xionghc / Facial-Expression-Recognition

Facial-Expression-Recognition in TensorFlow. Detecting faces in video and recognize the expression(emotion).
GNU General Public License v3.0
641 stars 191 forks source link

image_to_tensor in (image)函数里为什么要除以255.0? #22

Closed ryangawei closed 5 years ago

ryangawei commented 6 years ago

在model.py文件中 def image_to_tensor(image): tensor = np.asarray(image).reshape(-1, 2304) * 1 / 255.0 return tensor

LeonardNiu commented 6 years ago

在model.py文件中 def image_to_tensor(image): tensor = np.asarray(image).reshape(-1, 2304) * 1 / 255.0 return tensor

我觉得应该是把灰度从0-255变换到0-1范围内,提高图像的亮度,使图像的细节更加清楚

xionghc commented 6 years ago

The value of pixies is range from 0 to 255, the purpose of dividing 255 is normalization.