Practice Deep Learning Bootcamp - Assignment 2 - Beginners: Recognize an Animal in an Image Challenge | DPhi

Image recognition is a vital component in robotics such as driverless vehicles or domestic robots. Image recognition is also important in image search engines such as Google or Bing image search whereby you use rich image content to query for similar stuff. Like in Google photos where the system uses image recognition to categorize your images into things like cats, dogs, people and so on so that you can quickly search your albums for things like, “give me photos of my cat”, that's awesome.


This is a companion discussion topic for the original entry at https://dphi.tech/practice/challenge/34

Hey
When i extract the train_beg folder in the colab notebook the order of the images changes and becomes unordered.
So how to make them in order with the labels_csv

Hi @talal
One of the way could be to load the images in the same order as given in the csv file i.e. make use of that csv file while loading the images… Other could be you can make use of for loops and lists though this will be a long procedure.

1 Like

The image size is (200,300,3) and there are 1000 images.
I know how to convert them to numpy array but how to keep all these 1000 3d numpy arrays into one training variable

1 Like

Hi @talal
While converting those to a numpy array, assign it to a variable. This will work.

I am having a problem in my training process i.e the accuracy and loss of my model is not changing rather it remains constant.Even if i train it on gray images
Help!

Hi @talal
If your model accuracy is not changing at all, it might be better to use a different Optimizer or Loss Function

I am facing the same issue, Can you give an example.

Thanks @gunnika it worked!!

2 Likes

When I copied this code, # cloning the Datasets repository
!git clone https://github.com/dphi-official/Datasets.git

copying the contents of the animal data folder to Google Drive

!cp -r Datasets/animal_data /content/animal_data/

to my Jupyter Notebook, it showed this error

‘git’ is not recognized as an internal or external command,
operable program or batch file.
‘cp’ is not recognized as an internal or external command,
operable program or batch file.

Please help me out with the error.

Please I need help with building the model. I have loaded the dataset using Method 1 from the Help Notebook sent. But i don’t know how to split the data and parse it into the model. The data type is LIST.

2 Likes

Hi @justus
Converting the images to numpy array is also given in the help notebook itself in the last cell. Also, there was a mandatory notebook to go through before attempting the assignment 2 ‘https://github.com/dphi-official/Deep_Learning_Bootcamp/blob/master/OpenCV/DL_Day12_OpenCV.ipynb

Try this to load and extract the training dataset:

!wget https://github.com/dphi-official/Datasets/blob/master/animal_data/train_beg.zip?raw=true
!unzip /content/train_beg.zip?raw=true

can we solve the Assignment in our own way and perform all the task ?

should we gray scale the images one by one or all at once. I need help for that. I’ve seen help notebooks too but i’m little confused about that

Yes, you do in any way. But you should complete the tasks mentioned in assignment tasks

You can use for loops to grayscale and pre-process the images

How to load images using flow_from_directory ? I have tried a lot, I always end up getting

Found 0 images belonging to 0 classes.

My directory structure in google colab: /data/train_beg

My Code:

train_generator = datagen_train.flow_from_directory('/content/data/train_beg/',

                                                    target_size = (img_size,img_size),

                                                   color_mode = 'grayscale',

                                                   batch_size = batch_size,

                                                   class_mode = 'categorical',

                                                   shuffle = True)
2 Likes

same problem here…

Found 0 images belonging to 0 classes.
I am receiving this error while running model.fit the below code
history = model.fit_generator( train_generator , # train_generator
epochs=60,# epochs, verbose=1,
validation_data = validation_generator)

Can someone please guide me on this issue?