The script was originally written for TensorFlow 0.12 but modified later for TensorFlow 1.1, and has been verified to also run OK in the TensorFlow 1.4 with Python 2.7 environment we set up earlier.
![](img/c462927f-71be-46f1-995f-5cbd536ae175.png)Figure 4.7 Showing the choice of two style models
两张已传输图像的结果,out_style [19] = 1.0; 如图 4.8 所示:
两张已传输图像的结果,`out_style[19] = 1.0`; 如图 4.8 所示:
![](img/cc28a550-1a66-4845-b330-1c01d3806e62.png)Figure 4.8 The style-transferred results with two different models (fast style transfer on the left, multi-style on the right)
...
...
@@ -597,7 +597,7 @@ for (int i=0; i < intValues.length; ++i) {
}
```
注意,多样式模型返回浮点数数组 至 `outputValues` ,它们的范围都在 0.0 到 1.0 之间,因此我们需要将它们相乘 在应用左位移操作以获取 Red 和 Green 值之前,先进行 255 乘以 255,然后对 `intValues` 数组的每个元素应用按位“或”设置最终 ARGB 值。