Pedestrian detection using the TensorFlow Object Detection API. Includes multi GPU parallel processing inference.
Branch: master
Clone or download
Latest commit b11c7d6 Aug 25, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
annotations Added files Jul 30, 2018
nanonets Added files Jul 30, 2018
object_detection Fix issue #1 Aug 12, 2018
slim Added files Jul 30, 2018
.gitignore Added files Jul 30, 2018 minor readme update Aug 25, 2018 Added files Jul 30, 2018 Added files Jul 30, 2018 Added files Jul 30, 2018
fps.png Added files Jul 30, 2018
output.gif Added files Jul 30, 2018
requirements.txt Added files Jul 30, 2018 Added files Jul 30, 2018


Pedestrian Detection using the TensorFlow Object Detection API and Nanonets. [Blog][Performance]

Pedestrian Detector in action

This repo provides complementary material to this blog post, which compares the performance of four object detectors for a pedestrian detection task. It also introduces a feature to use multiple GPUs in parallel for inference using the multiprocessing package. The count accuracy and FPS for different models (using 1,2,4 or 8 GPUs in parallel) were calculated and plotted.


The TownCentre dataset is used for training our pedestrian detector. You can use the following commands to download the dataset. This automatically extracts the frames from the video, and creates XML files from the csv groundtruth. The image dimensions are downscaled by a factor of 2 to reduce processing overhead.



1. For TensorFlow Object Detection API

Refer to the instructions in this blog post.

2. For Nanonets

Step 1: Clone the repo

git clone
cd object-detection-sample-python
sudo pip install requests

Step 2: Get your free API Key

Get your free API Key from

Step 3: Set the API key as an Environment Variable


Step 4: Create a New Model

python ./code/

Note: An environment variable NANONETS_MODEL_ID will be created in the previous step, with your model ID.

Step 5: Upload the Training Data

Place the training data in a folder named images and annotations in annotations/json

python ./code/

Step 6: Train the Model

python ./code/

Step 7: Get Model State

The model takes ~2 hours to train. You will get an email once the model is trained. In the meanwhile you check the state of the model

python ./code/

Step 8: Make Predictions

Create a folder named 'test_images' inside the 'nanonets' folder. Place the input images in this folder, and then run this command.

python ./code/




For more stats, refer to the blog post. The performance of each model (on the test set) was compiled into a video, which you can see here.

In light of GDPR and feeble accountability of Deep Learning, it is imperative that we ponder about the legality and ethical issues concerning automation of surveillance. This blog/code is for educational purposes only, and it used a publicly available dataset. It is your responsibility to make sure that your automated system complies with the law in your region.