我试图对列表中的每个图像并行应用相同的变换(HOGs/模糊)。图像是使用cv2.imread导入的numpy ndarray,并保存到列表中
当前,当我将图像列表传递给函数时,数组中的一个条目似乎被传递,即图像中的一个像素而不是整个图像。您能否建议如何将整个阵列/映像传递给池中的每个工作进程
谢谢
# imports
from functools import partial
from skimage.feature import hog
from multiprocessing import Pool
def findhog(image):
return hog(image, visualise=True)[1] # hog returns two things, only return the visualisation
with Pool(processes=4) as pool:
hogs = pool.map(findhog, listofimages)
目前没有回答
相关问题 更多 >
编程相关推荐