Skip to content

Instantly share code, notes, and snippets.

View InEase's full-sized avatar
💭
I may be slow to respond.

TransMux InEase

💭
I may be slow to respond.
View GitHub Profile
import numpy as np
per_level_scale = 1.381912879967776
log2_per_level_scale = np.log2(per_level_scale)
base_resolution = 16
log2_hashmap_size = 14
HashIn = np.load("./HashIn.npy")
HashOut = np.load("./HashOut.npy")[0:65536]
HashWeight = np.load("./HashWeight.npy")
@InEase
InEase / show.py
Created July 6, 2022 00:48
Show picture examples of DataLoader/Dataset images with masks
# example of train images with masks
ds = HuBMAPDataset(transforms=augmentations)
dl = DataLoader(ds, batch_size=bs, shuffle=False, num_workers=NUM_WORKERS)
imgs, masks = next(iter(dl))
plt.figure(figsize=(16, 16))
for i, (img, mask) in enumerate(zip(imgs, masks)):
img = ((img.permute(1, 2, 0) * std + mean) * 255.0).numpy().astype(np.uint8)
plt.subplot(8, 8, i + 1)
plt.imshow(img, vmin=0, vmax=255)