(frames, save_path=None, title="Video Sequences Batch with Statistics")
| 48 | plt.show() |
| 49 | |
| 50 | def 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 | |
| 67 | def visualize_multiple_batches(dataloader, num_batches=3, save_dir="batch_visualizations"): |
| 68 | os.makedirs(save_dir, exist_ok=True) |
no test coverage detected