MCPcopy
hub / github.com/richzhang/PerceptualSimilarity / save_images

Method save_images

util/visualizer.py:174–192  ·  view source on GitHub ↗
(self, webpage, images, names, image_path, title='')

Source from the content-addressed store, hash-verified

172
173 # save image to the disk
174 def save_images(self, webpage, images, names, image_path, title=''):
175 image_dir = webpage.get_image_dir()
176 # short_path = ntpath.basename(image_path)
177 # name = os.path.splitext(short_path)[0]
178 # name = short_path
179 # webpage.add_header('%s, %s' % (name, title))
180 ims = []
181 txts = []
182 links = []
183
184 for label, image_numpy in zip(names, images):
185 image_name = '%s.jpg' % (label,)
186 save_path = os.path.join(image_dir, image_name)
187 util.save_image(image_numpy, save_path)
188
189 ims.append(image_name)
190 txts.append(label)
191 links.append(image_name)
192 webpage.add_images(ims, txts, links, width=self.win_size)
193
194 # save image to the disk
195 # def save_images(self, webpage, visuals, image_path, short=False):

Callers

nothing calls this directly

Calls 2

get_image_dirMethod · 0.80
add_imagesMethod · 0.80

Tested by

no test coverage detected