本文整理汇总了Python中thunder.rdds.fileio.imagesloader.ImagesLoader.mean方法的典型用法代码示例。如果您正苦于以下问题:Python ImagesLoader.mean方法的具体用法?Python ImagesLoader.mean怎么用?Python ImagesLoader.mean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thunder.rdds.fileio.imagesloader.ImagesLoader
的用法示例。
在下文中一共展示了ImagesLoader.mean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mean
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import mean [as 别名]
def test_mean(self):
from test_utils import elementwiseMean
arys, shape, size = _generateTestArrays(2, 'uint8')
imageData = ImagesLoader(self.sc).fromArrays(arys)
meanVal = imageData.mean()
expected = elementwiseMean(arys).astype('float16')
assert_true(allclose(expected, meanVal))
assert_equals('float64', str(meanVal.dtype))
示例2: test_mean
# 需要导入模块: from thunder.rdds.fileio.imagesloader import ImagesLoader [as 别名]
# 或者: from thunder.rdds.fileio.imagesloader.ImagesLoader import mean [as 别名]
def test_mean(self):
from numpy import mean
arys, shape, size = _generate_test_arrays(2, 'uint8')
imagedata = ImagesLoader(self.sc).fromArrays(arys)
meanval = imagedata.mean()
def elementwise_mean(arys):
# surprising that numpy doesn't have this built in?
combined = vstack([ary.ravel() for ary in arys])
meanary = mean(combined, axis=0)
return meanary.reshape(arys[0].shape)
expected = elementwise_mean(arys).astype('float16')
assert_true(allclose(expected, meanval))
assert_equals('float16', str(meanval.dtype))