代码如下:
x = numpy.asarray(image.convert('RGBA')).copy()
x[:, :, 3] = (255 * (x[:, :, :3] != 255).any(axis=2)).astype(numpy.uint8)
当 x 非常大时,小内存的机器上就会因为内存不足而 memory error,有什么好办法优化吗?
x = numpy.asarray(image.convert('RGBA')).copy()
x[:, :, 3] = (255 * (x[:, :, :3] != 255).any(axis=2)).astype(numpy.uint8)
当 x 非常大时,小内存的机器上就会因为内存不足而 memory error,有什么好办法优化吗?