figures.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:odin 作者: imito 项目源码 文件源码
def resize_images(x, shape):
  from scipy.misc import imresize

  reszie_func = lambda x, shape: imresize(x, shape, interp='bilinear')
  if x.ndim == 4:
    def reszie_func(x, shape):
      # x: 3D
      # The color channel is the first dimension
      tmp = []
      for i in x:
        tmp.append(imresize(i, shape).reshape((-1,) + shape))
      return np.swapaxes(np.vstack(tmp).T, 0, 1)

  imgs = []
  for i in x:
    imgs.append(reszie_func(i, shape))
  return imgs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号