81 questions
1
vote
0
answers
111
views
Roboflow Annotation for YOLO
We are using YOLO for object detection in satellite images to detect greenhouses.
I'm annotating images through Roboflow. I've downloaded satellite images with different zoom levels. (zoom level means ...
0
votes
0
answers
74
views
How can I get more images after augmenting each image?
I'm new to tensorflow. I want to generate more images after image augmentation but images and labels are (10, None, 400, 400, 3) and (10, None, 1) respectively and I guess it artifically count as 1 ...
0
votes
0
answers
56
views
the data augmentation doesn't work properly
according to me, the given code should create 5700 images, which is 10 times the number of original images, instead, when I check the shape of it, it only gives 1140, which is twice the number of ...
1
vote
1
answer
111
views
How to utilize the .experimental module in tensorflow without generating attribute error
I'm following a tutorial on data augmentation by aladdin persson. In the tutorial, some preprocessing modules in tensorflow were still being experimented as at time (3yrs ago) such as RandomFlip, ...
0
votes
1
answer
3k
views
'Image' object has no attribute 'shape'
I am trying to implement prime augmentation on my dataset. Previously I was getting error raise ValueError('pic should be 2/3 dimensional. Got {} dimensions.'.format(pic.ndim))
ValueError: pic should ...
0
votes
0
answers
490
views
ValueError: pic should be 2/3 dimensional. Got 4 dimensions
I am trying to implement an augmentation function to my images and masks, I have defined the augmentations like below:
if config.AUG == "PRIMEAugmentation":
augmentations = [autocontrast,...
0
votes
1
answer
83
views
RuntimeError: output with shape [320, 320, 3] doesn't match the broadcast shape [320, 320, 320, 320, 3]
I am trying to implement an augmentation function to my images and masks, I have defined the augmentations like below:
if config.AUG == "PRIMEAugmentation":
augmentations = [autocontrast,...
0
votes
1
answer
73
views
Image augmentation for dataset creation
I want to create an image dataset of leaf dataset. For this i captured images and found 6 classes, each classes has roughly 70-60 images. Noe while creating training and validation set, i know i ...
0
votes
1
answer
37
views
NameError: name 'pil_mask' is not defined
This is my code. I have defined various operations like this:
def identity(pil_img, pil_mask, _):
return pil_img, pil_mask
def autocontrast(pil_img, pil_mask, _):
return ImageOps.autocontrast(...
1
vote
2
answers
1k
views
How to normalize Imagenet dataset with pytroch?
I am trying to write a simple code to teach resnet50 on ImageNet dataset. I don't quite get why normalization does not work. When I use this transformation as data augmentation:
train_transforms = ...
0
votes
1
answer
598
views
How to achieve updated values on bounding box coordinates after Image Augmentation using albumentations?
I'm trying to expand the volume of my dataset using an image augmentation package called albumentations. I have 1145 images and their corresponding annotations labelled in Yolo format.
I'm having a ...
0
votes
1
answer
180
views
TF Keras - Image augmentation whilst excluding one class but recombining the data later on for use with an ImageDataGenerator object
I'm trying to augment the ISIC 2019 dataset images with 9 classes. The 'NV' class is overrepresented (12876 of a total of 25331 images) so I'd like to exclude it from the augmentation process but ...
1
vote
1
answer
754
views
Augmentation and transformations in Detectron2
I'm working on a custom Faster RCNN with Detectron2 framework and I have a doubt about transformation during training and inference. I created a custom Trainer inheriting from DefaultTrainer class and ...
1
vote
0
answers
1k
views
Data augmentation using keras.layers.RandomRotation() doesnt yield same results
In my project I have dataset of original images and correcponding masks. I want to perform augmentation so it is random, yet same for image and matching mask. For this I have defined keras sequential ...
0
votes
1
answer
368
views
Checking Data Augmentation in Pytorch
i used image augmentation in pytorch before training in unet like this
class ProcessTrainDataset(Dataset):
def __init__(self, x, y):
self.x = x
self.y = y
self.pre_process = transforms....
0
votes
1
answer
194
views
How does data augmentation work with preprocessing function that is called with map method
In a tutorial I found this code to do data augmentation:
def preprocess_with_augmentation(image, label):
resized_image = tf.image.resize(image, [224, 224])
# data augmentation with Tensorflow
...
4
votes
2
answers
12k
views
Getting AttributeError: 'FigureCanvasAgg' object has no attribute 'set_window_title' using IMGAUG python package
I have found this simple code below on some internet page, but I'm getting an error trying to execute it on my laptop. It should display an image with some bounding boxes on it.
The error occurs not ...
0
votes
1
answer
296
views
want to know how can i solved this error "cannot select an axis to squeeze out which has size not equal to one"
plt.figure(figsize=(10, 10))
for images, labels in x_train:
plt.imshow(np.squeeze(images,0))
plt.title('Color map: Magma'+str(labels\[0,0\]))
plt.axis("off")
break
ValueError: cannot select ...
0
votes
1
answer
652
views
Augment multiple images and bounding boxes in a folder with different classes
I'm a beginner. I have annotated dataset in YOLO format. I would like to know how to apply the same augmentation pipeline with the same parameters to a folder of images with their corresponding ...
1
vote
1
answer
273
views
How can I apply imgaug augmentation to a tensorflow dataset created with dataset_from_directory?
I'm curently trying to apply some data augmentation using imgaug to my existing trainDataset.
The dataset is created using dataset_from_directory as shown below.
trainDataset = tf.keras.utils....
0
votes
0
answers
82
views
How many images are generated when Image augmentation is used (either for individual image or for all image)
How can I determine how many images will be created after image augmentation via tensorflow ImageDataGenerator.
What will be that number for an individual image and likewise all images.
I have total ...
1
vote
1
answer
418
views
Steps per epoch (with image augmentation) not changing with batch size
I have read that one can increase steps per epoch by 2 or 3 times when applying image augmentation. I have also done that in the past with no issue, however this time I've got an error telling me I ...
0
votes
1
answer
121
views
Tensorflow Multiple Image augmentations that don't have layers
I am using
train_data_gen = tf.keras.utils.image_dataset_from_directory(...)
AUTOTUNE = tf.data.AUTOTUNE
train_data_gen = train_data_gen.cache().prefetch(buffer_size=AUTOTUNE)
I want to apply ...
2
votes
1
answer
657
views
Augmentation layer warnings in tensorflow 2.10
In tensorflow 2.10.0 I am trying some data augmentation layers, for example:
data_augmentation = keras.Sequential(
[
layers.RandomFlip('horizontal'),
layers.RandomRotation(0.1),#...
0
votes
1
answer
848
views
detectron2 - how to verify the number of images after augmentation?
I can see that augmentations were applied but i can't see the resulted size of the training set. How can I check it? It's important because when calculating epochs, the dataset size after augmentation ...
0
votes
1
answer
906
views
Augment a tf.data.Dataset with has image and mask. Both Needs to be augmented
I have a tf.data.Dataset of image paths of image and masks
# Creating list of image and mask path
all_val_img = np.array(sorted([os.path.join(VAL_DIR,i) for i in os.listdir(VAL_DIR)]))
all_val_mask = ...
1
vote
0
answers
123
views
How to save file adding previous name as prefix after ImageDataGenerator
Using ImageDataGenerator of Keras.
suppose my folder structure is like
a -
1.jpg
2.jpg
3.jpg
b -
5.jpg
6.jpg
7.jpg
I am doing the augmentation like below :
for i in range (20):
for ...
0
votes
0
answers
162
views
Can anyone please help me with generating new images using GAN?
I've been trying to generate (255x255) images using GAN, although I am able to train and generate 28x28 MNIST images, but I'm not able to generate custom images. I tried changing a lot of parameters ...
0
votes
1
answer
804
views
Data generator for image classification
I'm trying to create a data generator for my CNN project(using a sequential model in keras). Due to the large amount of data, I need to keep flowing data to the model training so I dont get OOM on RAM....
0
votes
1
answer
2k
views
How to enlarge dataset using augmentations in Pytorch
If i enlarge my dataset using augmentations, I get a better result?
For example, I have 1 class, it is a dog class and 4 images for it. I applied augmentations to 4 images. Now some of these images ...
0
votes
0
answers
52
views
Image Augmentation not altering my images at all
I am trying to implement some image augmentation to my dataset of brain scan MRIs. I'm using the same code from the TensorFlow tutorial page, yet it does not seem to be augmenting my images at all:
...
-1
votes
2
answers
1k
views
Albumentations - Read images after augmentation
I would like to know how to read (if it is possible) an image after augmentation by Albumentations.
I tried:
my_img = 'xyz.jpg'
image = cv2.imread(my_img)
image = cv2.cvtColor(image, cv2....
0
votes
1
answer
776
views
Is it possible automate to changing all colors in an image to random colors?
I'm trying to come up with a new image augmentation that changes colors like above automatically, but to everything not just the flower. The above is a photoshop example but I'd like to automatically ...
0
votes
1
answer
505
views
The colour of my images get changed after augmentation
I am using Keras and ImageDataGenerator to augment the images in a directory and save it in another folder. After Augmentation the colour of the images turn bluish negativish and i dont want the ...
0
votes
0
answers
348
views
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/...
0
votes
0
answers
535
views
Image Perspective Augmentation
I would like to perform data augmentation on an image, changing its perspective.
I have tried using albumentations.augmentations.geometric.transforms.Perspective but it is really very limited. In fact ...
0
votes
0
answers
318
views
Problem with Transforming and Augmenting images in pytorch
I want to apply augmentation methods to my image. For this, I chose codes from this website https://pytorch.org/vision/stable/transforms.html
image = cv2.imread('image.png')
augmentation = torch.nn....
0
votes
2
answers
3k
views
Will using image augmentation techniques in pytorch increase the dataset size on local machine also
I was training a custom model in pytorch and the dataset was very uneven. As in there are 10 classes for which some class have only 800 images while some have 4000 images. I found that image ...
0
votes
1
answer
231
views
flow_image_from_directory : uncorrect number of images generated
I'm performing multiclass image classification using "xception" model and fine-tuning it.
I don't have a large quantity of data so I am doing data augmentation thanks to ...
0
votes
1
answer
78
views
How can make blackout on my images like when screen blackout due to cookie warning?
I want to do basic augmentation on my train datasets. I'll write the code but I need to help. How can I make blackout like this, can you send an example code (just for blackout) or anything?
As you ...
0
votes
1
answer
389
views
How to do image augmentation on the actual dataset, so that I don't need to add label for every augmented image
I want to do augmentation on a dataset containing images as an np-array stored in X_train and its label stored in y_train.
Shapes are as follows:
print(X_train.shape)
print(y_train.shape)
Output:
(...
0
votes
1
answer
34
views
Image classifier only predicting 2 out of 6 classes and val accuracy is high, what is happening?
I'm new to machine learning and I'm working on a dataset with 14k pictures of sea, forest, glaciers, streets, buildings and mountains (6 classes). I have been training my model with it and achieved a ...
1
vote
1
answer
233
views
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, # ...
2
votes
1
answer
3k
views
I got error trying to use albumentations on tensorflow data pipeline
Im pretty new at deep learning and tensorflow, then when i try to use albumentations on tensorflow data pipeline, this error occurs (i use google colabs):
error: OpenCV(4.1.2) /io/opencv/modules/core/...
1
vote
1
answer
611
views
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(...
0
votes
1
answer
349
views
Changing RGB channel intensities using Keras ImageDataGenerator
I have been trying to augment my around 360 images while training a model. This is how the code looks like
img_data_gen_args = dict(rotation_range=90,
width_shift_range=0.3,
...
2
votes
1
answer
482
views
Image augmentation on deep learning training data
I have a question about mean and standard deviation in image augmentation.
Are the two parameters recommended to be filled in?
If so, how could I know the number? Do I have to iterate through the data,...
1
vote
1
answer
142
views
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 ...
1
vote
1
answer
578
views
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 ...
2
votes
1
answer
770
views
How resize dataset label in albumentations label to work with tensorflow image_dataset_from_directory function?
I am running the following code:
[https://pastebin.com/LK8tKZtN]
The error obtained is following:
File "C:\Users\Admin\PycharmProjects\BugsClassfications\main2.py",
line 45, in set_shapes *...