本文整理匯總了Python中util.util.save_image方法的典型用法代碼示例。如果您正苦於以下問題:Python util.save_image方法的具體用法?Python util.save_image怎麽用?Python util.save_image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util.util
的用法示例。
在下文中一共展示了util.save_image方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generate
# 需要導入模塊: from util import util [as 別名]
# 或者: from util.util import save_image [as 別名]
def generate(self):
#pass
data=self.get_network_input()
model.set_input(data)
visuals=model.get_latent_noise_visualization()
image_dir='./imgs'
for label,image_numpy in visuals.items():
image_name='test_%s.png' % (label)
save_path=os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
## convert back from pil image to cv2 image
if self.enable_shadow:
cv2_img = cv2.imread('imgs/test_fake_B_shadow.png')
else:
cv2_img = cv2.imread('imgs/test_%d_L_fake_B_inter.png'%(self.which_shadow_img))
self.drawWidget.setShadowImage(cv2_img)
self.visWidget.update_vis('imgs/fake_B_gallery.png')
示例2: generate
# 需要導入模塊: from util import util [as 別名]
# 或者: from util.util import save_image [as 別名]
def generate(self):
#pass
data=self.get_network_input()
model.set_input(data)
visuals=model.get_latent_noise_visualization()
image_dir='./imgs'
for label,image_numpy in visuals.items():
image_name='test_%s.png' % (label)
save_path=os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
## convert back from pil image to cv2 image
if self.enable_shadow:
cv2_img = cv2.imread('imgs/test_fake_B_shadow.png')
else:
cv2_img = cv2.imread('imgs/test_%d_L_fake_B_inter.png'%(self.which_shadow_img))
self.drawWidget.setShadowImage(cv2_img)
self.visWidget.update_vis('imgs/fake_B_gallery.png')
示例3: generate
# 需要導入模塊: from util import util [as 別名]
# 或者: from util.util import save_image [as 別名]
def generate(self):
data=self.get_network_input()
model.set_input(data)
visuals=model.get_latent_noise_visualization()
image_dir='./imgs'
for label,image_numpy in visuals.items():
image_name='test_%s.png' % (label)
save_path=os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
## convert back from pil image to cv2 image
if self.enable_shadow:
cv2_img = cv2.imread('imgs/test_fake_B_shadow.png')
else:
cv2_img = cv2.imread('imgs/test_%d_L_fake_B_inter.png'%(self.which_shadow_img))
cv2_img = cv2.resize(cv2_img,(self.img_size,self.img_size))
self.drawWidget.setShadowImage(cv2_img)
data = self.get_network_input_color()
model_color.set_input(data)
model_color.test()
visuals = model_color.get_current_visuals()
image_dir = './imgs'
for label,image_numpy in visuals.items():
image_name = 'test_color_%s.png' % (label)
save_path = os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
self.visWidget_color.update_vis('imgs/test_color_fake_B.png')
示例4: generate
# 需要導入模塊: from util import util [as 別名]
# 或者: from util.util import save_image [as 別名]
def generate(self):
#pass
data=self.get_network_input()
model.set_input(data)
visuals=model.get_latent_noise_visualization()
image_dir='./imgs'
for label,image_numpy in visuals.items():
image_name='test_%s.png' % (label)
save_path=os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
## convert back from pil image to cv2 image
if self.enable_shadow:
cv2_img = cv2.imread('imgs/test_fake_B_shadow.png')
else:
cv2_img = cv2.imread('imgs/test_%d_L_fake_B_inter.png'%(self.which_shadow_img))
cv2_img = cv2.resize(cv2_img,(self.img_size,self.img_size))
self.drawWidget.setShadowImage(cv2_img)
data = self.get_network_input_color()
model_color.set_input(data)
model_color.test()
visuals = model_color.get_current_visuals()
image_dir = './imgs'
for label,image_numpy in visuals.items():
image_name = 'test_color_%s.png' % (label)
save_path = os.path.join(image_dir,image_name)
util.save_image(image_numpy,save_path)
self.visWidget_color.update_vis('imgs/test_color_fake_B.png')