本文整理汇总了Python中multiprocessing.pool.ThreadPool.daemon方法的典型用法代码示例。如果您正苦于以下问题:Python ThreadPool.daemon方法的具体用法?Python ThreadPool.daemon怎么用?Python ThreadPool.daemon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.pool.ThreadPool
的用法示例。
在下文中一共展示了ThreadPool.daemon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_batch_images
# 需要导入模块: from multiprocessing.pool import ThreadPool [as 别名]
# 或者: from multiprocessing.pool.ThreadPool import daemon [as 别名]
def load_batch_images(params, direction, x, patch_loc,map_loc):
#We should modify this function to load images with different number of channels
size=params["size"]
im_type=params["im_type"]
patch_use=params['patch_use']
sbt=1
if(im_type=="depth"):
normalizer=52492
sbt=params["depth_mean"]
if(im_type=="pre_depth"):
normalizer=52492
sbt=params["pre_depth_mean"]
if(im_type=="gray"):
normalizer=255
sbt=params["gray_mean"]
if(im_type=="rgb"):
normalizer=255
sbt=params["rgb_mean"]
if(im_type=="hha_depth_fc6"):
normalizer=47.2940864563
sbt=params["hha_depth_fc6_mean"]
if(im_type=="rgb_conv4_2"):
normalizer=8010.15771484
sbt=params["rgb_conv4_2_mean"]
if(im_type=="rgb_conv5_2"):
normalizer=1042.07519531
sbt=params["rgb_conv5_2_mean"]
im_order=0
if(direction=="S"):
im_order=1
map_arg=[(direction, im_type, normalizer, patch_loc,map_loc, patch_use, sbt, size, im[im_order]) for im in x]
pool_img = ThreadPool(params["n_procc"])
pool_img.daemon=True
results = pool_img.map(load_image_wrapper,map_arg)
pool_img.close()
pool_img.join()
batch_l=convert_set(results,im_type)
return numpy.array(batch_l)