Spaces:
Running
Running
ddpm
Browse files
app.py
CHANGED
@@ -258,8 +258,8 @@ def greet(input):
|
|
258 |
|
259 |
#samples, intermediate = sample_ddim_context(32, ctx, n=steps)
|
260 |
|
261 |
-
|
262 |
-
samples, intermediate = sample_ddim_context(image_count, ctx, steps)
|
263 |
|
264 |
#samples, intermediate = sample_ddim(32, n=steps)
|
265 |
#ctx = F.one_hot(torch.randint(0, 5, (32,)), 5).to(device=device).float()
|
@@ -269,16 +269,19 @@ def greet(input):
|
|
269 |
#response2 = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[1]))
|
270 |
#response = im.fromarray(intermediate[24][0][1]).convert("RGB")
|
271 |
|
272 |
-
sx_gen_store = np.moveaxis(intermediate,2,4)
|
273 |
-
nsx_gen_store = norm_all(sx_gen_store, sx_gen_store.shape[0], image_count)
|
274 |
-
|
275 |
-
response = intermediate.shape;
|
276 |
-
response2 = transform2(transform(nsx_gen_store[-1][0]))
|
277 |
-
|
278 |
sx_gen_store = np.moveaxis([samples],2,4)
|
279 |
nsx_gen_store = norm_all(sx_gen_store, sx_gen_store.shape[0], image_count)
|
280 |
|
281 |
response3 = transform2(transform(nsx_gen_store[-1][0]))
|
|
|
|
|
|
|
282 |
# response3 = transform2(transform(nsx_gen_store[-1][1]))
|
283 |
# response4 = transform2(transform(nsx_gen_store[-1][2]))
|
284 |
# response5 = transform2(transform(nsx_gen_store[-1][3]))
|
|
|
258 |
|
259 |
#samples, intermediate = sample_ddim_context(32, ctx, n=steps)
|
260 |
|
261 |
+
samples, intermediate = sample_ddpm_context(image_count, steps, ctx)
|
262 |
+
# #samples, intermediate = sample_ddim_context(image_count, ctx, steps)
|
263 |
|
264 |
#samples, intermediate = sample_ddim(32, n=steps)
|
265 |
#ctx = F.one_hot(torch.randint(0, 5, (32,)), 5).to(device=device).float()
|
|
|
269 |
#response2 = transform2(transform(np.moveaxis(samples.detach().cpu().numpy(),1,3)[1]))
|
270 |
#response = im.fromarray(intermediate[24][0][1]).convert("RGB")
|
271 |
|
272 |
+
# # sx_gen_store = np.moveaxis(intermediate,2,4)
|
273 |
+
# nsx_gen_store = norm_all(sx_gen_store, sx_gen_store.shape[0], image_count)
|
274 |
+
#
|
275 |
+
# response = intermediate.shape;
|
276 |
+
# response2 = transform2(transform(nsx_gen_store[-1][0]))
|
277 |
+
#
|
278 |
sx_gen_store = np.moveaxis([samples],2,4)
|
279 |
nsx_gen_store = norm_all(sx_gen_store, sx_gen_store.shape[0], image_count)
|
280 |
|
281 |
response3 = transform2(transform(nsx_gen_store[-1][0]))
|
282 |
+
|
283 |
+
|
284 |
+
|
285 |
# response3 = transform2(transform(nsx_gen_store[-1][1]))
|
286 |
# response4 = transform2(transform(nsx_gen_store[-1][2]))
|
287 |
# response5 = transform2(transform(nsx_gen_store[-1][3]))
|