Occupancy Intelligence: Turning a Security Camera Into a People Analytics Tool
Most security cameras spend their lives recording footage that nobody watches. This system repurposes a standard IP camera into a continuous occupancy sensor, automatically building a visual picture of how a space is used over time — without storing any video or retaining images of individuals.
At its core, the system periodically captures a still image from a fixed camera and runs it through an AI object detection model trained to recognize people. Rather than recording who those people are or what they are doing, it simply notes where in the frame they appear. That location information is added to a running heat map — a kind of spatial memory that accumulates across hours, days, and weeks. The more time people spend in a particular part of the room, the warmer that area becomes on the map.
A significant challenge with this kind of system is detecting people who are far from the camera, partially obscured, or seated. Standard AI detection models are optimized for clear, close-up subjects and can struggle at range. This system addresses that by dividing the image into a grid of smaller tiles and analyzing each tile independently. A person who appears small in the full image fills a much larger portion of their local tile, making them significantly easier to detect. A separate analysis pass on the full image simultaneously catches people who are close to the camera and too large to fit neatly into a single tile. Results from both passes are automatically reconciled so each person is counted only once.
The system is designed for reliability and low maintenance. The heat map accumulates continuously and is saved to disk after every capture cycle, so no data is lost if the system is restarted. A dedicated web server runs alongside the capture process, serving a live viewer page that automatically refreshes on the same schedule as the camera captures. Anyone on the local network can pull up the current heat map in a browser without needing access to the server itself.
The entire system runs in software containers, which isolates it cleanly from the underlying server and makes it straightforward to move to different hardware or restart after a failure. GPU acceleration is used for the AI detection workload, keeping processing times well within the capture interval even at full camera resolution. The result is a self-contained, always-on occupancy analysis tool that runs quietly in the background and delivers continuously updated insight into how a physical space is actually being used.
Code: http://hs-gitea.cs.rutgers.edu:3000/hackerspace/camera-heatmap