# Object-Classification-and-Localization-with-TensorFlow **Repository Path**: stemon/Object-Classification-and-Localization-with-TensorFlow ## Basic Information - **Project Name**: Object-Classification-and-Localization-with-TensorFlow - **Description**: This repository is containing an object classification & localization project for SINGLE object. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-09 - **Last Updated**: 2021-04-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Object-Classification-and-Localization-with-TensorFlow This is a multiclass image classification & localization project for SINGLE object using CNN's and TensorFlow on Python3. # Dependencies ```pip3 install requirements.txt``` # Training (GPU) Cloning the repository to local machine: ```git clone https://github.com/MuhammedBuyukkinaci/Object-Classification-and-Localization-with-TensorFlow``` Changing directory to this folder ```cd Object-Classification-and-Localization-with-TensorFlow``` 1 ) Augmenting data: ```python3 create_training_data.py ``` 2 ) Training the CNN: ```python3 train.py ``` 3 ) Testing on unseen data: ```python3 test.py ``` # Training on CPU I trained on a GTX 1050. 1 epoch lasted 10 seconds approximately. If you are using CPU, which I do not recommend, change the lines below in train.py: ``` config = tf.ConfigProto(allow_soft_placement=True) config.gpu_options.allow_growth = True config.gpu_options.allocator_type = 'BFC' with tf.Session(config=config) as sess: ``` to ``` with tf.Session() as sess: ``` # Data 3 categories: Cucumber, eggplant and mushroom. 188 images from 3 categories were used in this project. Images used in this project are in **training_images** folder. You can also download them from [here](https://www.kaggle.com/mbkinaci/image-localization-dataset).
7 ) Separating labelled data as train and CV in **train.py**.
8 ) Defining our architecture in **train.py**. I used [AlexNet](https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf) for model architecture.
9 ) Creating 2 heads for calculating loss in **train.py**. One head is classification loss. The other head is regression loss.
10 ) Training the CNN on a GPU (GTX 1050 - One epoch lasted 10 seconds approximately)
11 ) Testing on unseen data (**testing_images** folder) collected from the Internet(in **test.py**).
# Architecture
AlexNet is used as architecture. 5 convolution layers and 3 Fully Connected Layers with 0.5 Dropout Ratio. 60 million Parameters.

# Predictions
