question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Applying transforms to a batch of images

See original GitHub issue

Hi.

I am aware of this guide that shows how to apply transforms to multiple images, masks, etc. But I am not sure how I could extend this to use inside a more generic pipeline with tf.data.

Consider the existing guide that shows how to use albumentations with TensorFlow. It applies the augmentation transforms to single examples and for a larger dataset, it can quickly become very expensive. Rather, applying the pipeline on batches might be more efficient as stated here.

How can we achieve this i.e. how can we modify the augmentation pipeline, in this case, to allow a batch of images to be processed?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
sayakpaulcommented, Apr 22, 2021

I see. But having it supporting batches might beneficial for the tf.data pipeline since tf.numpy_function is already very expensive.

0reactions
GuillaumeLeclerccommented, Jul 5, 2021

GPU augmentations are very useful in nodes having many GPUs (8-16). In environments with many jobs running it is not acceptable to use 20+ cores for a single GPU job as machines run out of available cores before they run out of GPUs. Having (most of the time) very expensive GPUs idle is a massive waste of resources. So even if it was slightly slower it is still a crucial addition in my opinion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can transforms.Compose handle a batch of Images? - vision
I have a preprocessing pipeling with transforms.Compose() . However, I'm wondering if this can also handle batches in the same way as nn....
Read more >
How to apply a transformation on multiple images?
Transformations can be added on the fly to any image just by updating its URL.For example, let's say you've created a named...
Read more >
Batch support for Transform? #157 - pytorch/vision - GitHub
Any plans for updating Transform to support batch inputs instead of just single images? This is useful for applying transforms outside of a ......
Read more >
Apply transformation matrix to batch of images - Google Groups
I'm having difficulty conceptualizing the fastest way to perform this transformation to a single image, let alone the entire batch of images. In...
Read more >
How to apply image transform to a list of images and maintain ...
You got the error because try apply transformation of single image to list: A more convenient way to get a batch of any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found