deeplearning

deeplearning / CrowdCounter / 0.3.0

README.md

1. Introduction

Crowd Counter is an algorithm that takes in a photo and returns the number of people in it. The algorithm uses deep learning to create a heatmap highlighting regions where there is a person, and uses this heatmap to come up with a estimate of the count.

Input:

  • (Required) Image Data API Url, Web (http/https) Url, binary image, base64 encoded image or an array of data API URLs / web URLs.

Output:

  • Estimated number of people in the image, as an integer, or a list of estimated numbers of people, if the input is an array of images.

Note: This algorithm works best with a large number of people(e.g., ~100), since it is trained on such data. It is likely to produce incorrect results with images containing too few people.

Note: The first call to this algorithm will take a bit longer than sequential calls due to algorithm initialization. All following calls will be significantly faster.

2. Examples

Example 1.

  • Parameter 1: Data API Url
{
    "image": "data://deeplearning/example_data/Batsheva_theater_crowd.jpg"
}

Output:

{
    "count": 65
}

Example 2.

  • Parameter 1: HTTPS Url
{
    "image": "https://en.wikipedia.org/wiki/Audience#/media/File:Batsheva_theater_crowd_in_Tel_Aviv_by_David_Shankbone.jpg"
}

Output:

{
  "count": 65
}

Example 3.

  • Parameter 1: Base64 image
{
    "image": "data:image/png;base64....",
}

Output;

{
  "output": 42
}

Example 4.

  • Parameter 1: An array of Data API Urls
{  
   "image":[  
      "data://deeplearning/Temp/sample_image_1.png",
      "data://deeplearning/Temp/sample_image_2.png",
      "data://deeplearning/Temp/sample_image_3.png"
   ]
}

Output:

{
  "count": [12, 42, 84]
}

3. Credits

For more information, please refer to Single-Image Crowd Counting via Multi-Column Convolutional Neural Network

Demo image was retrieved from Wikipedia, and it is licensed under CC BY-SA 3.0 : https://en.wikipedia.org/wiki/Audience#/media/File:Batsheva_theater_crowd_in_Tel_Aviv_by_David_Shankbone.jpg