Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
darpan-jain authored Feb 18, 2019
1 parent 443a0ee commit d2edf69
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CROWD COUNTER

## Contents
- [People](#introduction)
- [Nature](#nature)
- [Objects](#objects)
- [Places](#places)
- [Symbols](#symbols)
- [Uncategorized](#uncategorized)


### Introduction

This repository contains the code of performing the task of implementing a people counter from an overhead video surveillance camera by using Transfer Learning.
Expand All @@ -13,25 +22,23 @@ This repository contains the code of performing the task of implementing a peopl
<p align="center">
<img src="https://github.com/darpan-jain/crowd-counter/blob/master/pretrained-results/result1.png" width="640px" height="480px"/></p>

- Clearly, using the pre-trained models is not the way to go. So, ~~Pre-Trained Models~~
- Clearly, using the pre-trained models is not the way to go. So, ~~Pre-Trained Models~~ :confused:


### Training your custom model

A custom model had to trained for accurate implementation. The following steps were taken for the same:

1. **Annotated training data** had to be prepared before being given to the model.
1. **Annotated training data** had to be prepared before being given to the model fot training.
1. ***LabelImg*** was used for this purpose, to draw bounding boxes around objects of interest in the training images.
1. LabelImg gives output as **xml** files containing coordinates of each of the bounding boxes in an image and the associated label of the object.
1. All the xml files were converted to a ***train.csv*** and then into a ***train.record*** format. TFRecord format is required by Tensorflow to perform training of a custom model.
1. Similarly a ***val.record*** was created for validation data.
1. The architecture of the model is based on the **Faster RCNN** algorithm, which is an efficient and popular object detection algorithm which uses deep convolutional networks.
1. The model config file was modified for the purpose of this assignment.
1. The last 90 neuron classification layer of the network was removed and replaced with a new layer that gives output for only one class i.e. person.
1. The config file of the model was modified. The last 90 neuron classification layer of the network was removed and replaced with a new layer that gives output for only one class i.e. person.
1. The **config file** for the same can be found in `./data/utils/faster_rcnn.config`
1. After training the model, the checkpoint model is saved as `model.pb` file.
1. This model can now be deployed and used for obtaining inferences
1. The test images were the first 10 frames of the mall dataset.
1. This model can now be deployed and used for obtaining inferences on crowd images.

- The model can be found on this drive link: ​[Custom Model](https://drive.google.com/open?id=1IBgEyaASf10KUFTCbky9mtruUpyoqDWR)

Expand All @@ -42,9 +49,13 @@ Upon running `main.py`, the results are as shown below. (Refer `./results`)

<p align="center">
<img src="https://github.com/darpan-jain/crowd-counter/blob/master/results/result0003.jpg" width="640px" height="480px"/></p>

<p align="center">
<img src=" " width="640px" height="480px"/></p>

***Note:*** Since the model was trained on only **30** annotated images, the accuracy can be significantly increased by using a larger dataset to build the model.


### Prerequisites
All the required dependencies can be install by running the command `pip install -r requirements.txt`

Expand Down

0 comments on commit d2edf69

Please sign in to comment.