本文整理汇总了Python中mxnet.ndarray.swapaxes方法的典型用法代码示例。如果您正苦于以下问题:Python ndarray.swapaxes方法的具体用法?Python ndarray.swapaxes怎么用?Python ndarray.swapaxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mxnet.ndarray
的用法示例。
在下文中一共展示了ndarray.swapaxes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: subtract_imagenet_mean_batch
# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def subtract_imagenet_mean_batch(batch):
"""Subtract ImageNet mean pixel-wise from a BGR image."""
batch = F.swapaxes(batch,0, 1)
(r, g, b) = F.split(batch, num_outputs=3, axis=0)
r = r - 123.680
g = g - 116.779
b = b - 103.939
batch = F.concat(r, g, b, dim=0)
batch = F.swapaxes(batch,0, 1)
return batch
示例2: subtract_imagenet_mean_preprocess_batch
# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def subtract_imagenet_mean_preprocess_batch(batch):
"""Subtract ImageNet mean pixel-wise from a BGR image."""
batch = F.swapaxes(batch,0, 1)
(r, g, b) = F.split(batch, num_outputs=3, axis=0)
r = r - 123.680
g = g - 116.779
b = b - 103.939
batch = F.concat(b, g, r, dim=0)
batch = F.swapaxes(batch,0, 1)
return batch
示例3: add_imagenet_mean_batch
# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def add_imagenet_mean_batch(batch):
batch = F.swapaxes(batch,0, 1)
(b, g, r) = F.split(batch, num_outputs=3, axis=0)
r = r + 123.680
g = g + 116.779
b = b + 103.939
batch = F.concat(b, g, r, dim=0)
batch = F.swapaxes(batch,0, 1)
"""
batch = denormalizer(batch)
"""
return batch
示例4: preprocess_batch
# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def preprocess_batch(batch):
batch = F.swapaxes(batch, 0, 1)
(r, g, b) = F.split(batch, num_outputs=3, axis=0)
batch = F.concat(b, g, r, dim=0)
batch = F.swapaxes(batch, 0, 1)
return batch
示例5: swapaxes
# 需要导入模块: from mxnet import ndarray [as 别名]
# 或者: from mxnet.ndarray import swapaxes [as 别名]
def swapaxes(input, axis1, axis2):
return nd.swapaxes(input, axis1, axis2)