MCPcopy Create free account
hub / github.com/AlmondGod/tinyworlds / visualize_batch_with_stats

Function visualize_batch_with_stats

scripts/visualize_batch.py:50–65  ·  view source on GitHub ↗
(frames, save_path=None, title="Video Sequences Batch with Statistics")

Source from the content-addressed store, hash-verified

48 plt.show()
49
50def visualize_batch_with_stats(frames, save_path=None, title="Video Sequences Batch with Statistics"):
51 # Move to CPU and get dimensions
52 frames = frames.detach().cpu()
53 batch_size, seq_len, C, H, W = frames.shape
54 frame_mean = frames.mean().item()
55 frame_std = frames.std().item()
56 frame_min = frames.min().item()
57 frame_max = frames.max().item()
58 visualize_batch(frames, save_path, title)
59 return {
60 'mean': frame_mean,
61 'std': frame_std,
62 'min': frame_min,
63 'max': frame_max,
64 'shape': frames.shape
65 }
66
67def visualize_multiple_batches(dataloader, num_batches=3, save_dir="batch_visualizations"):
68 os.makedirs(save_dir, exist_ok=True)

Callers 1

Calls 1

visualize_batchFunction · 0.85

Tested by

no test coverage detected