MCPcopy
hub / github.com/NVlabs/SPADE / save_images

Method save_images

util/visualizer.py:139–159  ·  view source on GitHub ↗
(self, webpage, visuals, image_path)

Source from the content-addressed store, hash-verified

137
138 # save image to the disk
139 def save_images(self, webpage, visuals, image_path):
140 visuals = self.convert_visuals_to_numpy(visuals)
141
142 image_dir = webpage.get_image_dir()
143 short_path = ntpath.basename(image_path[0])
144 name = os.path.splitext(short_path)[0]
145
146 webpage.add_header(name)
147 ims = []
148 txts = []
149 links = []
150
151 for label, image_numpy in visuals.items():
152 image_name = os.path.join(label, '%s.png' % (name))
153 save_path = os.path.join(image_dir, image_name)
154 util.save_image(image_numpy, save_path, create_dir=True)
155
156 ims.append(image_name)
157 txts.append(label)
158 links.append(image_name)
159 webpage.add_images(ims, txts, links, width=self.win_size)

Callers 1

test.pyFile · 0.80

Calls 4

get_image_dirMethod · 0.80
add_headerMethod · 0.80
add_imagesMethod · 0.80

Tested by

no test coverage detected