All Questions
26 questions
0
votes
1
answer
47
views
can I store the (64,64) and labels as RGB?
I have images as 64x64 numpy images that look like this:
This image is labeled as 5. I have 5 different categories (classes). Is there any way I can store this image as RGB or (64,64,5)?
RG as center ...
0
votes
1
answer
655
views
Get transparent background by using mask, I get white background
def combined_display(image, matte):
# calculate display resolution
w, h = image.width, image.height
rw, rh = 800, int(h * 800 / (3 * w))
# obtain predicted foreground
image = np.asarray(...
0
votes
1
answer
820
views
Why does image_dataset_from_directory return a different array than loading images normally?
I noticed that the output from TensorFlow's image_dataset_from_directory is different than directly loading images (either by PIL, Keras' load_img, etc.). I set up an experiment: I have a single RGB ...
0
votes
0
answers
162
views
ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following types in the input[<class 'builtin_function_or_method'>]
I am working on Face Mask Detection using Tensorflow and Keras.
The part of the Code that causes the error is:
new_model.fit(X, Y, epochs = 5, validation_split = 0.1)
The line of code before this is:
...
1
vote
1
answer
442
views
Preprocessing an image dataset including division into training and test sets
I am learning multiimage classification with deep learning models. I am using Keras and Tensorflow for the classification task.
The image dataset (10,000 images) is an array and the labels are in a ...
0
votes
1
answer
867
views
Extract misclassified images using CNN keras
I am having difficulties extracting misclassified images, I tried to use the following line of code:
inc= np.nonzero(model.predict_classes(test_data).reshape(-1,))
print (inc)
but this doesn't work, ...
0
votes
2
answers
194
views
Compare values of numpy array (The truth value of an array with more than one element is ambiguous. Use a.any() or a.all())
So I'm using Keras generator to get data augmented for image segmentation
I have a specific mask which each set of pixel represent a region of my masks, so I must have a range of pixel that contains ...
0
votes
1
answer
684
views
In image dataset loading into numpy array, How can I convert image's 3d format into 2d?
To load my image dataset, I have done following coding
X=[]
for i in range(1,682):
image=Image.open(str(i)+'.jpg')
image=image.resize((100,100))
temp=asarray(image)
X.append(temp)
...
-1
votes
1
answer
141
views
Why train NumPy array size is smaller than the whole dataset?
I converted all the images, with the size of 100 x 100, into a numpy array and save it into a text file. After loading it and performing train_test_split, they're stored into X_train and X_test ...
1
vote
1
answer
78
views
Convert multidimensional array elements into same number of arrays
I am doing a Computer Vision project in which I am getting an error 'setting an array element with a sequence' when I am trying to change the data type of input image matrix.
I realized this is ...
0
votes
1
answer
3k
views
Add homogeneous coordinate (x0=1) to images in numpy
I have 7 images of size 29*29, I want to add one homogenous coordinate (augment them
with feature, x0=1) to all 7 images, but I am not sure how to do it.
my original image dimension is
images.shape ...
0
votes
1
answer
1k
views
Invalid combination of arguments - eq()
I'm using a code shared here to test a CNN image classifier. When I call the test function, I got this error on line 155:
test_acc += torch.sum(prediction == labels.data)
TypeError: eq() received an ...
2
votes
1
answer
19k
views
Pytorch TypeError: eq() received an invalid combination of arguments
num_samples = 10
def predict(x):
sampled_models = [guide(None, None) for _ in range(num_samples)]
yhats = [model(x).data for model in sampled_models]
mean = torch.mean(torch.stack(yhats), ...
6
votes
3
answers
11k
views
fastest way to load images in python for processing
I want to load more than 10000 images in my 8gb ram in the form of numpy arrays.So far I have tried cv2.imread,keras.preprocessing.image.load_image,pil,imageio,scipy.I want to do it the fastest way ...
-1
votes
1
answer
147
views
Numpy salt and pepper image on color region?
I have tons of images that look like the following:
I want to add random black and white pixels (salt and pepper) to those images, but only within the colored circle. The black border around the ...