Skip to content

Instantly share code, notes, and snippets.

View maciej-adamiak's full-sized avatar

Maciej Adamiak maciej-adamiak

View GitHub Profile
from denoising_diffusion_pytorch import Unet, GaussianDiffusion, Trainer
if __name__ == '__main__':
model = Unet(
dim=64,
dim_mults=(1, 2, 4, 8)
)
diffusion = GaussianDiffusion(
model,
@maciej-adamiak
maciej-adamiak / dataset.py
Created February 13, 2021 20:45
Parallel Tensorflow image read
import cv2
import glob
import numpy as np
import tensorflow as tf
def process_image(image_size, path, preserve_file=False):
path = path.decode('utf-8')
image = cv2.imread(path, cv2.IMREAD_UNCHANGED)
image = cv2.resize(image, (image_size, image_size))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.