2024-04-20 01:05:24 发布
网友
我想遍历图像列表,将其转换为numpy.darray并将其存储在azure blob存储中。我想将np.array附加到azure blob的每个循环。总体目标是通过azure blob整合y轴上的所有图像
简单的演示可能会有所帮助。要将映像转换为数组,请首先安装Pillow以使用PIL
from azure.storage.blob import BlockBlobService from PIL import Image from numpy import asarray import numpy as np import os account_name = '<your storage account name>' account_key = '<your access key>' container_name = '<your container name>' blob_service = BlockBlobService(account_name, account_key) FilePathlist = ['xxxxx', 'xxxxx'] blob = [] for filePath in FilePathlist : print(filePath) # load the image image = Image.open(filePath) # convert image to numpy array data = asarray(image) # append np.array blob = np.append(blob, data) # Upload to blob print("upload") blob_service.create_blob_from_bytes(container_name, "aaaaa.jpg", blob.tobytes())
我尝试了这个,并将它们上传到blob
参考:
Uploading array as a .jpg image to Azure blob storage
文件numpy.append
Convert image to NumPy Array
简单的演示可能会有所帮助。要将映像转换为数组,请首先安装Pillow以使用PIL
我尝试了这个,并将它们上传到blob
参考:
Uploading array as a .jpg image to Azure blob storage
文件numpy.append
Convert image to NumPy Array
相关问题 更多 >
编程相关推荐