Questions tagged [image-classification]
579 questions
2
votes
1 answer
How to view the image from test generator to see if the prediction is correct or not
I am training a fruit classification model. As of right now my classes are:
['Fresh Apples', 'Fresh Bananas', 'Fresh Oranges']
I am using train, validation, and test generators using ImageDataGenerator and flow_from_directory. I have trained the…

LeGOATJames23
- 101
- 7
2
votes
1 answer
How to upload images in a class-specific folders to Azure Blob Storage on Azure ML Studio
I am trying to run an image classifier using Keras on Azure ML Studio. However, I have huge amount of images sorted into class-specific subfolders on my local machine that I'd like to upload to Azure Blob Storage. When I use "Create Dataset" there…

Shora Dehkordi
- 51
- 3
2
votes
0 answers
What does "register" do in detecron2 for training custom dataset?
When I read the "Use Custom Datasets" section on the detectron2 web page, I saw that I needed to register my dataset. The web page says:
" If you want to use a custom dataset while also reusing detectron2’s
data loaders, you will need to:
Register…

hande
- 31
- 2
- 5
2
votes
1 answer
resnet50 theory question - output shape and dense layers units?
i am learning tensorflow/keras for image classification and i feel like i'm missing a critical part of the theory.
the task that i am currently working on deals with using a pretrained model (Resnet50 in this case) to do classification on a small…

seuadr
- 141
- 11
2
votes
2 answers
How to add the last classification layer in EfficieNet pre-trained model in Pytorch?
I'm using the EfficientNet pre-trained model for my image classification project in Pytorch, and my purpose is to change the number of classes which is initially 1000 to 4.
However, for that when I try adding a model._fc layer, I keep on seeing this…

FarnooshAzour
- 23
- 1
- 6
2
votes
0 answers
XGBoost image classification Bad Allocation error
So I am using Xgboost for an image classification problem but I am getting a Bad Allocation error when running model.fit and passing the train data. I think that the problem must be the data but its in a 2d array as supported by XGBoost also when…

Dylan Galdes
- 21
- 1
2
votes
1 answer
Fast.ai:ModuleAttributeError: 'Sequential' object has no attribute 'fine_tune'
When I use the fast.ai, T encounter this problem,the follow is my code:
from fastai.vision.all import *
from fastai.text.all import *
from fastai.collab import *
from fastai.tabular.all import *
device = torch.device('cuda:0' if…

ZachSun
- 21
- 1
2
votes
1 answer
Why use Variable() in inference?
I am learning PyTorch for an image classification task, and I ran into code where someone used a PyTorch Variable() in their function for prediction:
def predict_image(image):
image_tensor = test_transforms(image).float()
image_tensor =…

Sudhanshu
- 704
- 1
- 9
- 24
2
votes
0 answers
Neural Network cannot overfit even one sample
I am using neural network for a regression task.
My input is an gray image whose size is 100x70x1.
The gray area has a unique value 60.
The input will go through a preprocessing layer, which multiply 1./255 on every pixel value.
My output is just…

Kanda Wa
- 31
- 2
2
votes
1 answer
Identify misclassified images with Tensorflow
I have been working on an image classifier and I would like to have a look at the images that the model has misclassified in the validation. My idea was to compare the true and predicted values and used the index of the values that didn't match to…

mp97
- 48
- 6
2
votes
0 answers
Tensorflow Lite Model: Incompatible shapes for input and output array
I'm currently working on a Tensorflow Lite image classifier app that can recognice UNO cards. But when I'm running the float model in the class ImageClassifier, something is wrong.
The error is the next one:
java.lang.IllegalArgumentException:…

Gaia
- 31
- 5
2
votes
2 answers
why do we reshape the Mnist training images to (60000,28,28,1) instead of using it directly like this (60,28,28)?
This code is used in training model for image classification using Mnist dataset. what I don't understand is why we reshape the training images to (60000,28,28,1) instead of using it directly like this (60,28,28).
num_classes = 10
input_shape = (28,…

Vega
- 17
- 1
- 4
2
votes
0 answers
Android: TFLite giving giving wrong predictions compared to Python for same model
I am creating an Android app which requires running a tensorflow image classification model. I created the following simple model in Python:
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Flatten(input_shape=(28, 28,…

skdhfgeq2134
- 426
- 1
- 4
- 16
2
votes
1 answer
To split the main data directory into Train/validation/test Set
I am working on X-ray image classification for which my data is stored in 1 directory and I need to divide it into train,validation and test set. I did manage to separate train and validation set using ImagedDataGenerator but am having troubles to…

tammy
- 43
- 5
2
votes
0 answers
Keras flow from directory for multiple labels
If I have a directory structure like this:
|-data
|-train
|-Bellis perennis
| |-lawn_daisy
| | |-image1.jpg
| |-english_daisy
| |-image1.jpg
|-Tulipa dasystemon
| |-some tulip name
…

user14592110
- 21
- 2