Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
label
class label
16 classes
latent
sequence
55
[ [ [ 1.7754038572311401, 1.607332706451416, 1.8376060724258423, 1.7442153692245483, 1.8186455965042114, 1.7642557621002197, 1.685960054397583, 0.988777220249176, 1.0594961643218994, 0.9593173265457153, 1.2130686044692993, 0.9377129673957825,...
44
[ [ [ 0.4896619915962219, 0.32855236530303955, -0.11065097153186798, -0.277862548828125, -0.23755021393299103, 0.28085699677467346, 0.6471608877182007, 0.050682034343481064, -0.6125776171684265, -0.6359497904777527, -0.1944085657596588, -0.13...
66
[ [ [ -0.37715306878089905, 0.38398414850234985, -1.0630155801773071, -0.24297307431697845, -1.082515001296997, 0.003629047190770507, -2.068202495574951, -0.9232537150382996, -0.7714793086051941, -1.2798078060150146, -0.1454712301492691, -0.6...
44
[ [ [ 1.608289361000061, 1.3219895362854004, 1.15475594997406, 1.2058477401733398, 0.16104793548583984, -1.240822434425354, -1.2858132123947144, 0.40425264835357666, 1.6287367343902588, 0.6448529958724976, 0.1249096691608429, -1.3925740718841...
10a
[ [ [ -0.1456349790096283, 0.35586023330688477, 0.8735159635543823, 0.7308250069618225, 0.5351058840751648, 0.9521790146827698, 1.05719792842865, -0.13013501465320587, -0.5737802386283875, 0.14069265127182007, -0.48274850845336914, -1.6042321...
11
[ [ [ -1.5979397296905518, 1.0596896409988403, -0.9900341629981995, -0.3140685260295868, 0.23421750962734222, -0.2588115632534027, 0.21392270922660828, -0.2034139633178711, -0.21460768580436707, -0.01566029153764248, -0.09151645004749298, 0.1...
14e
[ [ [ -0.16238614916801453, 0.1247248649597168, 0.031325358897447586, 0.9145305156707764, 1.1727659702301025, 1.484236717224121, 1.1691781282424927, 1.5194660425186157, 1.6823656558990479, 1.283056616783142, 1.1526848077774048, 1.062094211578...
22
[ [ [ 0.130314439535141, 0.3983535170555115, 0.6567063331604004, 0.5041401386260986, 0.21720734238624573, 0.03739937022328377, 0.799809455871582, 0.47181007266044617, 0.29924634099006653, 0.16417308151721954, 0.02644953317940235, -0.013357006...
13d
[ [ [ 0.8648879528045654, -0.40350884199142456, 0.8253976106643677, 0.40991702675819397, -0.04549717158079147, 1.1696902513504028, 0.20559369027614594, 0.12715129554271698, 1.0058561563491821, 0.026534151285886765, 0.9042865633964539, 0.18464...
11
[[[1.5244190692901611,1.3618990182876587,1.3037453889846802,1.2363225221633911,1.0086064338684082,1.(...TRUNCATED)
End of preview. Expand in Data Studio

Dataset Card for "latent_lsun_church_128px"

Each image is cropped to 128px square and encoded to a 4x16x16 latent representation using the same VAE as that employed by Stable Diffusion

Decoding

from diffusers import AutoencoderKL
from datasets import load_dataset
from PIL import Image
import numpy as np
import torch
# load the dataset
dataset = load_dataset('tglcourse/latent_lsun_church_128px')
# Load the VAE (requires access - see repo model card for info)
vae = AutoencoderKL.from_pretrained("CompVis/stable-diffusion-v1-4", subfolder="vae")
latent = torch.tensor([dataset['train'][0]['latent']]) # To tensor (bs, 4, 16, 16)
latent = (1 / 0.18215) * latent # Scale to match SD implementation
with torch.no_grad():
    image = vae.decode(latent).sample[0] # Decode 
image = (image / 2 + 0.5).clamp(0, 1) # To (0, 1)
image = image.detach().cpu().permute(1, 2, 0).numpy() # To numpy, channels lsat
image = (image * 255).round().astype("uint8") # (0, 255) and type uint8
image = Image.fromarray(image) # To PIL
image # The resulting PIL image
Downloads last month
9