From 64cc718ead1bbda9787e55a1fc227c4e6481bc76 Mon Sep 17 00:00:00 2001 From: rromb Date: Sun, 5 Jun 2022 19:21:22 +0200 Subject: [PATCH] more specific dummy data --- ldm/data/dummy.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ldm/data/dummy.py b/ldm/data/dummy.py index be295a1..3b74a77 100644 --- a/ldm/data/dummy.py +++ b/ldm/data/dummy.py @@ -16,3 +16,19 @@ class DummyData(Dataset): letters = string.ascii_lowercase y = ''.join(random.choice(string.ascii_lowercase) for i in range(10)) return {"jpg": x, "txt": y} + + +class DummyDataWithEmbeddings(Dataset): + def __init__(self, length, size, emb_size): + self.length = length + self.size = size + self.emb_size = emb_size + + def __len__(self): + return self.length + + def __getitem__(self, i): + x = np.random.randn(*self.size) + y = np.random.randn(*self.emb_size).astype(np.float32) + return {"jpg": x, "txt": y} +