擅长:python、mysql、java
<p>您可以使用skimage的resize,如下所示</p>
<pre><code>from skimage import transform
new_features = np.array(list
(map
(lambda img: transform.resize(
img.reshape(8,8),#old shape
(32, 32), #new shape
mode='constant',
#flatten the resized image
preserve_range=True).ravel(),
features)))
</code></pre>
<p><code>new_features</code>形状将为(17971024),显示第一个图像将显示
<a href="https://i.stack.imgur.com/lZdjr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lZdjr.png" alt="enter image description here"/></a></p>