尝试在一个大数据集上提取HoG特征-总共70K。 所以测试值为28x28x70000 我想用游泳池。尝试前10张图片
from multiprocessing import Pool
def get_hog(inputImg):
fd,hi=hog(inputImg, orientations=4, pixels_per_cell=(4, 4),
cells_per_block=(1, 1), visualize=True, multichannel=False)
return fd
with Pool(5) as p:
V = p.map(get_hog,test_X[:,:,range(0,10)]))
我在V中的结果是空数组
可能传递数据的函数不正确?在
在python的多处理中, 应该始终尝试使用回调方法来存储进程返回的数据。 因此,对于您的示例,我们可以使用池并在图像列表上运行池(在您的例子中是
test_X
),并让回调处理池中每个进程返回的数据。 下面是示例代码:相关问题 更多 >
编程相关推荐