Questions tagged [image-augmentation]

84 questions
1
vote
0 answers

Data augmentation with tf.keras throwing "no such file or directory" error at for loop with .flow()

I am currently writing a script to augment a dataset for me using tf.keras (code given below). I'm pretty new to tf and data augmentation so I've been following a tutorial (https://blog.devgenius.io/data-augmentation-programming-e9a4703198be) pretty…
1
vote
1 answer

Number of augmented images on the fly in Keras

I have a code to augment images like the following, # Augmentation train_datagen = ImageDataGenerator(rotation_range=5, # rotation width_shift_range=0.2, # horizontal shift …
Neg
  • 41
  • 4
1
vote
1 answer

AffineTransform skimage without cutting off the edges

i am trying to transform image, that is rotated and a little skewed with Skimage. image = io.imread("id_1.jpg") afine_tf = tf.AffineTransform(shear=0.3, rotation=-0.5) modified = tf.warp(image,…
pl7771
  • 49
  • 4
1
vote
1 answer

Image Augmentation - TypeError: only size-1 arrays can be converted to Python scalars

I have a dataset of 279 images and i wish to perform augmentations with batch size of 4. Following is the code sample that i have written import numpy as np from skimage import io import os from PIL import Image from keras.preprocessing.image import…
1
vote
1 answer

Is it possible to iterate through Tensor in graph mode?

I am trying to implement Aleju's Imgaug to TFOD API. Noticed that you can not iterate through Tensors in the graph mode . I looked up for the solution and tried many suggestions but neither of them worked for my case. Do you know any work…
1
vote
1 answer

Augmentation using Albumentations in Pytorch OD

I followed the pytorch tutorial for object detection on the website here. I decided to add more augmentations using albumentations if it would improve my traning. However after calling the __getitem__() method in the dataset class I get this…
1
vote
1 answer

Augmented images saved as grey (imgaug,imageio, opencv)

I´m starting my first Computer Vision Project and wanted to tryout image augmentation to improve my dataset. I tried it with imgaug and everything works fine, as long as I only display them. But as as soon as I save them to a file they turn out…
st0412
  • 49
  • 4
1
vote
0 answers

Resizing with single value after padsquare(from augly) gives RuntimeError: stack expects each tensor to be equal size

I am facing a bit of a bizzare problem: I have a bunch of different sized images and I am trying to train+infer on these, and I have the following example transform code: import augly.image as imaugs import augly.utils as utils …
JohnJ
  • 6,736
  • 13
  • 49
  • 82
1
vote
1 answer

understanding transforms: resize and centercrop with same size

I am trying to understand this particular set of compose transforms: transform= transforms.Compose([transforms.Resize((224,224)…
AJW
  • 5,569
  • 10
  • 44
  • 57
1
vote
0 answers

Do we change the number of images in a dataset when we use Albumentations?

I'm new to data augmentation and so far I've gathered that it is used to make the dataset bigger by changing the data in it slightly(i.e. rotating or cropping) and adding the augmented images to the dataset. Does it work that way? And if so, I have…
1
vote
1 answer

ValueError: x_max is less than or equal to x_min for bbox

I am using albumentations for a set of images and bboxes. My bounding box is in "yolo" format, i.e., (x_mid, y_mid, width, height), all normalised. While running albumentations for a set of bounding errors, above error comes (ValueError: x_max is…
1
vote
2 answers

Image augmentation in Keras mixed functional model

I've created a mixed model in Keras, creating weights for metadata and image data and then combining them for the classification. Here's the model: Model:…
Yehuda
  • 1,787
  • 2
  • 15
  • 49
1
vote
2 answers

Image augmentation with Tensorflow so All classes have EXACT SAME number of images

I want to do multi class image classification for animal classification. The problem is my dataset has different number of images for each classes and the difference are quite awful. For example: In this example the dataset contains 320 images of 3…
1
vote
0 answers

Dtype Error while using image augmentation in Imgaug

I am using Imgaug for image augmentations on my training data. The code is as follows : training_augment = iaa.Sequential([iaa.Fliplr(0.5), iaa.Flipud(0.5), …
1
vote
0 answers

Custom data generator + Imgaug

I am using Imgaug for image augmentation along with Custom data generator for my CNN model for the classification 23 classes of X-ray body parts. I am not sure how would I pass my augmentation function to my def getitem function, in order to to see…