このKerasを使ったneural_style_transferのコードを読んでいたのですが、以下の関数で分からないところがあります。
Python
1def deprocess_image(x): 2 if K.image_data_format() == 'channels_first': 3 x = x.reshape((3, img_nrows, img_ncols)) 4 x = x.transpose((1, 2, 0)) 5 else: 6 x = x.reshape((img_nrows, img_ncols, 3)) 7 # Remove zero-center by mean pixel 8 x[:, :, 0] += 103.939 9 x[:, :, 1] += 116.779 10 x[:, :, 2] += 123.68 11 # 'BGR'->'RGB' 12 x = x[:, :, ::-1] 13 x = np.clip(x, 0, 255).astype('uint8') 14 return x
この「# Remove zero-center by mean pixel」の下の3行は何ですか?
画像のB, G, Rにそれぞれ103.939, 116. 779, 123.68を足してるのだと思いますが、これは何のための処理ですか?この数字はどこから来たのですか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/16 08:32
2018/01/16 08:39 編集
2018/01/16 08:46