Spaces:
Runtime error
Runtime error
da03
commited on
Commit
·
dffe378
1
Parent(s):
68b9a19
- online_data_generation.py +10 -0
online_data_generation.py
CHANGED
|
@@ -531,6 +531,16 @@ def generate_comparison_video(client_id, trajectory, output_file, start_time, en
|
|
| 531 |
|
| 532 |
def main():
|
| 533 |
"""Main function to run the data processing pipeline."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
# Initialize database
|
| 535 |
initialize_database()
|
| 536 |
|
|
|
|
| 531 |
|
| 532 |
def main():
|
| 533 |
"""Main function to run the data processing pipeline."""
|
| 534 |
+
|
| 535 |
+
# create a padding image first
|
| 536 |
+
padding_data = np.zeros((SCREEN_HEIGHT, SCREEN_WIDTH, 3), dtype=np.uint8)
|
| 537 |
+
padding_tensor = torch.tensor(padding_data).unsqueeze(0)
|
| 538 |
+
padding_tensor = rearrange(padding_tensor, 'b h w c -> b c h w').to(device)
|
| 539 |
+
posterior = autoencoder.encode(padding_tensor)
|
| 540 |
+
latent = posterior.sample()
|
| 541 |
+
latent = torch.zeros_like(latent).squeeze(0)
|
| 542 |
+
np.save(os.path.join(OUTPUT_DIR, 'padding.npy'), latent.cpu().numpy())
|
| 543 |
+
|
| 544 |
# Initialize database
|
| 545 |
initialize_database()
|
| 546 |
|