9e945725a4cfada7c9dc3688d567a7909c866687,tensorboardX/embedding.py,,make_sprite,#Any#Any#,24
Before Change
label_img = torch.from_numpy(make_np(label_img)) // for other framework
// augment images so that //images equals nrow*nrow
label_img = torch.cat((label_img, torch.randn(
nrow ** 2 - label_img.size(0), *label_img.size()[1:]) * 255), 0)
torchvision.utils.save_image(label_img, os.path.join(
save_path, "sprite.png"), nrow=nrow, padding=0)
def append_pbtxt(metadata, label_img, save_path, subdir, global_step, tag):
from posixpath import join
After Change
arranged_img_CHW = make_grid(make_np(label_img), ncols=nrow)
// augment images so that //images equals nrow*nrow
arranged_augment_square_HWC = np.ndarray((arranged_img_CHW.shape[2], arranged_img_CHW.shape[2], 3))
arranged_img_HWC = arranged_img_CHW.transpose(1, 2, 0) // chw -> hwc
arranged_augment_square_HWC[:arranged_img_HWC.shape[0], :, :] = arranged_img_HWC
im = Image.fromarray(np.uint8((arranged_augment_square_HWC * 255).clip(0, 255)))
im.save(os.path.join(save_path, "sprite.png"))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: lanpa/tensorboardX
Commit Name: 9e945725a4cfada7c9dc3688d567a7909c866687
Time: 2019-01-20
Author: huang.dexter@gmail.com
File Name: tensorboardX/embedding.py
Class Name:
Method Name: make_sprite
Project Name: jacobgil/pytorch-grad-cam
Commit Name: 5890d98d650b9bf3c1824f48fec96ad90c94fbbb
Time: 2020-01-11
Author: jacob.gildenblat@gmail.com
File Name: grad-cam.py
Class Name:
Method Name:
Project Name: lanpa/tensorboardX
Commit Name: 4debe684b9332a0fee78065f9d506c7119568d06
Time: 2017-08-15
Author: 178844@studenti.unimore.it
File Name: tensorboard/embedding.py
Class Name:
Method Name: make_sprite