Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
24d0256
1
Parent(s):
9c6b57e
utils.py
CHANGED
@@ -44,7 +44,11 @@ def sample_frame(model: LatentDiffusion, prompt: str, image_sequence: torch.Tens
|
|
44 |
#print (c['c_crossattn'].shape)
|
45 |
#print (c['c_crossattn'][0])
|
46 |
print (prompt)
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
print (image_sequence.shape, c['c_concat'].shape)
|
49 |
#c = model.enc_concat_seq(c, c_dict, 'c_concat')
|
50 |
# Zero out the corresponding subtensors in c_concat for padding images
|
|
|
44 |
#print (c['c_crossattn'].shape)
|
45 |
#print (c['c_crossattn'][0])
|
46 |
print (prompt)
|
47 |
+
# reshape(B, L * C, H, W)
|
48 |
+
#height, width, channels = image_sequence.shape
|
49 |
+
# use einsum to reshape
|
50 |
+
image_sequence = torch.einsum('hwc->chw', image_sequence).unsqueeze(0)
|
51 |
+
c = {'c_concat': image_sequence}
|
52 |
print (image_sequence.shape, c['c_concat'].shape)
|
53 |
#c = model.enc_concat_seq(c, c_dict, 'c_concat')
|
54 |
# Zero out the corresponding subtensors in c_concat for padding images
|