Upgrade Your CCTV With AI Visitor Counting

by KimY21 in Circuits > Cameras

27 Views, 1 Favorites, 0 Comments

Upgrade Your CCTV With AI Visitor Counting

Hackster_Cover_Image.png

Turn any old CCTV into a smart AI visitor counter that tracks people entering and leaving in real time, logs the data minute by minute, and gives you full historical analytics — all without writing a line of code. Works with USB, CSI, ONVIF, or RTSP cameras, runs on Grablo-supported devices, and even on a laptop with a built-in webcam if you just want to try it out.

Supplies

Hardware:

  1. Windows PC, Mac, Raspberry Pi, or any other Grablo-supported device
  2. Camera — USB, CSI, ONVIF, or RTSP (laptop webcam works too)
  3. Optional: USB video capture adapter if you're using an old analog CCTV without networking

Software:

  1. Grablo — No-Code IoT Platform (grablo.co)

Quick Start

Want to skip the build and just run it? Copy the project from the Grablo Gallery:

  1. Download and install Grablo software on your device from grablo.co/download
  2. Get this project from the Grablo Gallery
  3. Open the Grablo app at app.grablo.co in your browser
  4. Configure your camera in Settings → Camera → Edit (every CCTV is different — pick the type that matches yours and enter the address or index)
  5. Connect to your device and hit RUN!
  6. Open the dashboard and draw the counting line across your entrance in the camera view

If you'd rather build it from scratch, follow the steps below.

Create Dashboard

2026-05-02_22-53-03.png

Create a new project at app.grablo.co, name it "AI Visitor Counter," and select your device. Then create a dashboard and add the following widgets: a Camera widget for the live video feed, two Label widgets to display the In and Out counts side by side, and a Historical Chart widget for tracking visitor trends over time.

Set Up Logic

2026-05-02_22-51-49.png

The whole project runs on a single logic with two controls. The first control uses a Once condition so it fires just one time when the project starts. Inside it, an AI Analysis action creates a new AI Analyzer with the Line Cross Counter model. The Add Analysis command opens an editor where you draw the counting line across your entrance in the camera view, and you assign two variables — In Count and Out Count — that the AI will increment automatically as people cross.

Onfigure the Camera

The camera is intentionally left unconfigured because every CCTV is different. Go to Settings → Camera → Edit and pick the right type for your setup:

  1. USB webcam or analog CCTV with a video capture adapter: CSI/USB type, index 0
  2. Network IP camera: ONVIF or RTSP type with the camera's address and credentials

While you're there, pick the AI mode based on your device — Fast for low-power devices like a Raspberry Pi, Accurate for more powerful machines. If your device has a powerful GPU, turn on GPU acceleration for a major speed boost.

Launch Your Project

  1. Open the Grablo app and select your project
  2. Connect to your device
  3. Hit RUN!
  4. Open the dashboard and draw the counting line across your entrance in the camera view

Expected Results:

  1. The dashboard shows your live camera feed with the counting line drawn across
  2. As people walk past, the In or Out count goes up depending on direction
  3. The Historical Chart updates with new data points every minute
  4. Click the detail button (top-right of the chart) to set time ranges, switch to table view, or export CSV


Video Tutorial

Upgrade Your CCTV with AI Visitor Counting

Expand Your Project

  1. Add multiple counting lines to track different zones — lobby vs. checkout, for example
  2. Schedule a daily visitor report email at midnight using a Time Range condition and Send Email action
  3. Send a push alert when occupancy exceeds a threshold
  4. Combine multiple cameras into one dashboard for whole-building analytics

Troubleshooting:

  1. Camera feed not showing: double-check Settings → Camera → Edit — the project ships without camera credentials, so you need to enter your CCTV's details manually
  2. Counts not incrementing: make sure the counting line is drawn across the actual walking path, and click on the line to flip the In/Out direction if needed
  3. AI is slow: switch the AI mode to Fast, or enable GPU acceleration on a capable device
  4. Historical chart is empty: wait at least 1 minute after starting — that's the default logging interval