Questions tagged [data-augmentation]

Data augmentation

Data augmentation is the technique of increasing the size of data used for training a model. It also helps in preventing overfitting.

Some of the most common data augmentation techniques for images include:

  • Scaling
  • Cropping
  • Flipping
  • Rotation
  • Color jittering
465 questions
3
votes
1 answer

How can I get Class label from Mosaic augmentation in Object Detection Dataloader?

I'm trying to train an object detection model for a multi-class problem. In my training, I am using the Mosaic augmentation, Paper, for this task. In my training mechanism, I'm a bit stuck to properly retrieving the class labels of each category, as…
Innat
  • 16,113
  • 6
  • 53
  • 101
3
votes
1 answer

Should I use evaluate_generator or evaluate to evaluate my CNN model

I am implementing a CNN using keras to perform image classification and I had used .fit_generator() method to train the model till a stop condition is verified I used the next code: history_3conv = cnn3.fit_generator(train_data,steps_per_epoch =…
baddy
  • 369
  • 1
  • 3
  • 23
3
votes
1 answer

"args_0:0" when printing Tensor

I have an augmentation function that is being mapped into a generator; however, for some reason, the tfa.image.rotate function is causing an error. def customGenerator(input_file_paths, dims, data_type): for i, file_path in…
3
votes
0 answers

How to rotate bounding box for tf$keras$preprocessing$image$apply_affine_transform

I'm trying to write some functions for bounding box data augmentation. For image rotation I'm using tf$keras$preprocessing$image$apply_affine_transform. Original image looks like this: for which I have 3 bounding boxes (in YOLO format): test_bbox…
Maju116
  • 1,607
  • 1
  • 15
  • 30
3
votes
1 answer

Adding AdditiveGaussianNoise to a single image - AssertionError: Expected boolean as argument for 'return_batch'

I would like to add AdditiveGaussianNoise (link: https://imgaug.readthedocs.io/en/latest/source/overview/arithmetic.html#additivegaussiannoise) to a single image which I resized before. This is my code: from skimage.io import imread from…
Tobitor
  • 1,388
  • 1
  • 23
  • 58
3
votes
2 answers

Is it possible to use non-pytoch augmentation in transform.compose

I am working on a data classification problem that takes images as an input in Pytorch. I would like the use the imgaug library, but unfortunatly I keep on getting errors. Here is my code. #import necessary libraries from torch import nn from…
3
votes
1 answer

Custom ImageDataGenerator keras

I've been trying to implement Keras custom imagedatagenerator so that I can do hair and microscope image augmentation. This is the Datagenerator class: class DataGenerator( Sequence ): def __init__(self,image_paths,labels, augmentations,…
0xPrateek
  • 1,158
  • 10
  • 28
3
votes
1 answer

Resize Vs CenterCrop Vs RandomResizedCrop Vs RandomCrop

Can anyone tell me in which situations the above functions are used and how they affect the image size? I want to resize the Cat V Dogs images and i am a bit confuse about how to use them.
jastor_007
  • 371
  • 4
  • 14
3
votes
2 answers

Plot images from Image Generator

I'm trying to plot the images created by my image generator. So far this is the code of my data given to the generator: train_img_gen = train_img_data_gen.flow_from_directory(os.path.join(training_dir, 'images'), …
Mattia Surricchio
  • 1,362
  • 2
  • 21
  • 49
3
votes
2 answers

How to extract all tf.data.Dataset object into features and labels and pass into ImageDataGenerator's flow() method?

I am acutally working on a mini-project based on cifar10 dataset. I have loaded the data from tfds.load(...) and practicing image augmentation techniques. As I am using tf.data.Dataset object, which is my dataset, real-time data augmentation is…
3
votes
1 answer

How do I augment data after spliting traininng datset into train and validation set for CIFAR10 using PyTorch?

When classifying the CIFAR10 in PyTorch, there are normally 50,000 training samples and 10,000 testing samples. However, if I need to create a validation set, I can do it by splitting the training set into 40000 train samples and 10000 validation…
3
votes
1 answer

How to perform 10 Crop Image Augmentation at training time using Tensorflow 2.0 Dataset

I am using Tensorflow Dataset API and reading data from TFRecord files. I can use the map function and use method like random_flip_left_right, random_crop for data augmentation. However when I am trying to replicate AlexNet paper I am facing an…
3
votes
0 answers

Keras data augmentaion changes pixel values for masks (segmentation)

Iam using runtime data augmentation using generators in keras for segmentation problem.. Here is my data generator data_gen_args = dict( width_shift_range=0.1, height_shift_range=0.1, …
anilsathyan7
  • 1,423
  • 17
  • 25
3
votes
2 answers

Visualizing augmented train images [tensorflow object detection api]

It is possible to augment images in tensorflow object detection api config files, e.g.: data_augmentation_options { random_horizontal_flip { } } data_augmentation_options { ssd_random_crop { } } How can I visualize the training images to…
3
votes
1 answer

Do data augmentations by Tensorflow Object Detection API result in more samples than original?

So let's say my original raw dataset has 100 images. And I apply random_horizontal_flip data augmentation, which by default horizontally flips with 50% probability. So just for the sake of example, lets say it flips 50 of the 100 images. So, Does…
bappak
  • 865
  • 8
  • 23
1 2
3
30 31