Skip to content

feat: add batch visualization with make_grid and kornia augmentations#106

Open
Saivinay24 wants to merge 3 commits intokornia:masterfrom
Saivinay24:tutorials/ray-kornia-batch-augmentation
Open

feat: add batch visualization with make_grid and kornia augmentations#106
Saivinay24 wants to merge 3 commits intokornia:masterfrom
Saivinay24:tutorials/ray-kornia-batch-augmentation

Conversation

@Saivinay24
Copy link
Copy Markdown
Contributor

Description

Follow-up to #105. This PR enhances the Ray Data + Kornia-RS VLM pipeline tutorial with batch visualization and kornia augmentations, and includes fully executed notebook outputs for inline review.

Changes

  • Batch Grid Visualization: Added a cell using torchvision.utils.make_grid to display entire batches as a tiled grid — essential for debugging VLM data pipelines.
  • Kornia Augmentations: Added kornia.augmentation.AugmentationSequential demo with RandomHorizontalFlip, ColorJitter, RandomGaussianBlur, and RandomRotation.
  • Before vs. After Comparison: Side-by-side grid visualization of original vs. augmented batches.
  • Notebook Outputs Included: All cells fully executed so reviewers can see results inline.

Compatibility Fixes

  • Replaced kornia.image.make_grid (not available in kornia 0.8.2) with torchvision.utils.make_grid
  • Fixed n_rownrow parameter for torchvision API
  • Converted conversations column to str() to avoid Arrow nested dict conversion errors in Ray
  • Use image_ds.select_columns(["pixel_values"]) in visualization cells to avoid string column type errors

Content

  • Notebook: tutorials/data_loading/ray_vlm_pipeline.ipynb
  • Verified to run locally with ray[data], kornia_rs, kornia, and torch

Follow-up to PR kornia#105 as requested by maintainer edgarriba.

Changes:
- Add kornia to pip install dependencies
- New section: Batch Visualization with kornia.image.make_grid
- New section: Kornia Augmentations with AugmentationSequential
- Before/After comparison grid for augmented batches

Augmentations demonstrated:
- RandomHorizontalFlip
- ColorJitter (brightness, contrast, saturation, hue)
- RandomGaussianBlur
- RandomRotation
…mpatibility

- Execute all cells so outputs are included for PR review
- Replace kornia.image.make_grid with torchvision.utils.make_grid (kornia 0.8.2 compat)
- Fix n_row -> nrow parameter for torchvision API
- Convert conversations column to str() to avoid Arrow nested dict errors
- Use image_ds instead of processed_ds in visualization cells to avoid str column type errors
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant