adityaanantharaman / transfer-learning

Support code for the medium blog on transfer learning. Link to the blog in the Readme file.
105 stars 70 forks source link

Detect multiple classes in an image and making of dataset #2

Open NamburiSrinath opened 5 years ago

NamburiSrinath commented 5 years ago

Hi Aditya,

My question is related to multiple object detection in an image.

I have an image which has multiple classes like (car, 2 wheeler, pedestrain etc;). How can I detect all these objects along with their bounding boxes and probabilities by extending the code provided(mobilenet is fine)

How should my training data be like?

  1. Assume I have 3 classes. If I make 3 folders (namely car, pedestrain, 2 wheeler) and place all the corresponding images in these folders and follow your blog, will it work in detecting objects in an image that has all the 3 classes(bounding boxes + probabilities). If so, how to modify the code to get the boxes along with classes?

  2. Instead, I have an image where I have manually marked the bounding boxes for all the objects(using labelbox) so that I got a .txt file for each image(representing what all objects are present in that image and where are they). (I have images and their corresponding .txt files representing the objects coordinates present in that particular image). Can I use this information in any manner to detect multiple objects in an image? If so, how to modify the code?

Also how to use GPU to train. I attach a screenshot of my training process here

Screenshot from 2019-03-23 03-24-24

Thanks in advance Aditya

NamburiSrinath commented 5 years ago

Hi aditya,

I have converted the data to required format and I have learned how to use GPU and was able to build a model that can classify the image whether the image is cat/dog/horse.

Now, if I give a image having all the 3 classes, I need to predict the three classes along with their bounding boxes and probabilities.

Please look into this link for detailed explanation of the question https://stackoverflow.com/questions/55438285/mobilenet-to-detect-multiple-classes-in-an-image-with-coordinates

In short

How to change the last layer in such a way that I can get the coordinates of the multiple classes of an image

Thanks in advance Aditya