本文整理汇总了Python中texture.Texture.load_texture方法的典型用法代码示例。如果您正苦于以下问题:Python Texture.load_texture方法的具体用法?Python Texture.load_texture怎么用?Python Texture.load_texture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类texture.Texture
的用法示例。
在下文中一共展示了Texture.load_texture方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: simple_patches_synthesizer
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import load_texture [as 别名]
def simple_patches_synthesizer(args):
print "Using Simple Patches Synthesizer"
default_texture = Texture()
default_texture.load_texture(args.input_file)
patches = default_texture.create_patches(args.patch_height,
args.patch_width)
new_texture = Texture.create_simple_tex_from_patches(patches,
args.height,
args.width)
new_texture.save_texture(args.output_file)
return
示例2: mincut_overlap_patches_synthesizer
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import load_texture [as 别名]
def mincut_overlap_patches_synthesizer(args):
print "Using Mincut Overlap Patches Synthesizer"
default_texture = Texture()
default_texture.load_texture(args.input_file)
patches = default_texture.create_patches(args.patch_height,
args.patch_width,
overlap=args.overlap_percent)
new_texture = Texture.create_mincut_tex_from_patches(patches,
args.height,
args.width)
new_texture.save_texture(args.output_file)
return
示例3: texture_transfer
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import load_texture [as 别名]
def texture_transfer(args):
print "Texture Transfer Starting..."
source_texture = Texture()
source_texture.load_texture(args.source_texture)
target_image = Texture()
target_image.load_texture(args.target_image)
source_corr_texture = Texture()
target_corr_texture = Texture()
if args.corr_map_type == 0:
source_corr_texture.load_texture(args.source_texture, gray=True)
target_corr_texture.load_texture(args.target_image, gray=True)
elif args.corr_map_type == 1:
source_corr_texture.load_texture(args.source_texture,
gray=True, blur=True)
target_corr_texture.load_texture(args.target_image,
gray=True, blur=True)
patch_width = args.patch_width
patch_height = args.patch_height
new_t_height, new_t_width, dim = target_image.pixels.shape
texture = Texture()
texture.init_empty_texture(new_t_height, new_t_width, dim)
for step in range(args.iterations):
if args.iterations == 1:
alpha = .1
else:
alpha = .8 * step / (args.iterations-1) + .1
patches, source_patch_cmap = \
source_texture.create_patches(patch_height,
patch_width,
overlap=args.overlap_percent,
cmap=source_corr_texture)
texture = \
Texture.create_from_source_transfer_target(patches,
source_patch_cmap,
target_corr_texture,
texture,
alpha)
patch_width = int(patch_width * (1-args.patch_len_reduction))
patch_height = int(patch_height * (1-args.patch_len_reduction))
if patch_width == 0 or patch_height == 0:
print "patch width or height reduced to 0, stopping iterations"
break
texture.save_texture(args.output_file)
return