Views
No views yet
cs.toronto.edu/~emansim), for mediasynthesismuseum/aligndraw.aligndraw_coco.pt — trained weights (33M params; dims match the original coco-captions-32x32).model.py — the faithful PyTorch AlignDRAW definition.dictionary.pkl — the original 25,322-word caption dictionary (word → index; includes UNK).1import torch, pickle
2from model import AlignDRAW
3m = AlignDRAW(); m.load_state_dict(torch.load("aligndraw_coco.pt", map_location="cpu")); m.eval()
4d = pickle.load(open("dictionary.pkl","rb"), encoding="latin1")
5toks = [d.get(w, d["UNK"]) for w in "a red stop sign on a street corner .".split()]
6y = torch.tensor([toks]).expand(8, -1)
7imgs = m.generate(y) # (8, 3, 32, 32) in [0,1]