阅读背景:

python多线程/多进程编程

来源:互联网 

python多进程编程

def defin_canv(w, h):
    canvas = np.zeros((h, w))
    canvas[y0 - 1:y1, x0 - 1:x1] = 1
    return canvas

result = []
pool = multiprocessing.Pool()
#将对象放入到类别中,包含了返回的对象
for anno in box:
    result.append(pool.apply_async(defin_canv, args=(w, h)))
pool.close()
pool.join()
# 将数据取出来
for i in range(faces):
    canvas[i] = result[i].get()def defin_canv(w, h):
    canvas 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: