A digital signage system that uses AI face detection and gender estimation to automatically switch video content based on the viewer. When someone approaches the display, the AI detects their face, estimates gender, and plays the corresponding video. When nobody is watching, it falls back to an idle loop.
- AI face detection with gender estimation
- Proximity-based activation using face area calculation
- Automatic video switching with anti-flicker hold time
- Idle video loop when no viewer is detected
- Real-time monitoring dashboard
Targeted advertising displays are everywhere — retail stores, lobbies, trade shows — but they typically require expensive commercial software. This project shows how to build one with just a camera and a PC, using AI face detection to make the signage react to whoever is standing in front of it.
DemoQuick Start
- Install the Grablo software on your device from grablo.co/download
- Open this project in the Grablo Gallery and click "Copy to My Projects"
- Go to My Projects, open the copied project, and connect to your device
- Hit RUN and stand in front of the camera — the display switches content based on who's watching
The dashboard has 3 widgets: a Camera widget showing the live video feed, and two Labels displaying the detected gender and face area value. The camera takes up most of the screen with the labels on the side for real-time monitoring.
Logic
This project uses 4 logics with 5 controls total. The first logic handles face detection — on startup it initializes the camera, adds AI face detection to estimate gender, and continuously calculates face area (width × height). The face area acts as a proximity sensor: the closer the viewer, the larger the detected face.
The second and third logics handle video playback. When the face area exceeds 5, 000 pixels and the AI estimates the viewer as male, it stops any playing video and starts the male-targeted video. A separate logic does the same for female viewers. Both use a 3-second hold time to prevent rapid switching when detection fluctuates between frames.
The fourth logic plays an idle video. When the face area drops below 5, 000 pixels for 3 consecutive seconds — meaning the viewer walked away — it switches back to the idle loop.
Expected Results
- The camera feed appears on the dashboard with real-time gender and face area readouts
- Approach the camera — the AI detects your face and starts the corresponding video within seconds
- Walk away — after 3 seconds the display switches back to the idle video
- The 5, 000 px² threshold works well at about 1–2 meters; adjust in the logic for your setup distance
Hardware Setup
Camera
- Laptop with built-in camera — No setup needed, works out of the box
- USB Camera — Plug and play on PC or Raspberry Pi
- Raspberry Pi Camera Module (CSI) — Best performance on Pi
Display
- Laptop screen — Good for testing and demos
- External monitor via HDMI — For a proper signage installation
Tip: Position the camera at eye level facing the viewer for the best detection accuracy. Good lighting makes a big difference for gender estimation.
What's Next?
- Add age estimation to serve different content for different age groups
- Use multiple cameras to cover different viewing angles or zones
- Add a viewer counter to track daily demographics (male/female/total)
- Combine gender with time-of-day for more targeted content scheduling
- Connect multiple displays for a multi-screen signage setup
Troubleshooting
Face not detecting:Ensure good lighting and position the camera at eye level. Avoid strong backlighting or shadows on the face. The AI needs a clear frontal view.
Gender estimation inaccurate:Works best with clear, frontal face views at 1–2 meters distance. Side profiles and partially covered faces reduce accuracy. The 70% confidence threshold filters out uncertain detections.
Video switching too rapidly:The 3-second hold time prevents flickering, but you can increase it in the logic conditions for a smoother experience.
Camera feed not showing:For USB cameras, try a different port. For CSI cameras on Raspberry Pi, check the ribbon cable connection. Make sure the camera index matches your setup.





Comments