A real-time face detection application using OpenCV Haar cascades with optional Discord DM alerts.
This project was entirely vibe-coded as an experiment for me to gauge how well the Claude + OpenCode combo performs. I didn't one-shot this app. I took my time feeding it prompts one feature at a time and oversaw everything it did, giving it pointers whenever it failed or overlooked things. The fact that Claude was able to cook this up in the time that it did is quite impressive, but it does also have it's fair share of drawbacks.
- Real-time face detection (frontal and profile)
- Multi-threaded capture and detection for better performance
- Discord DM alerts with captured images when people are detected
- Configurable alert cooldown
- GPU acceleration support (OpenCL)
- Interactive camera selection
# Clone the repository
git clone <repo-url>
cd security
# Install dependencies
poetry install# Run with default settings (interactive camera selection)
poetry run python -m vibes_camera.camera
# Specify camera directly
poetry run python -m vibes_camera.camera --camera 0
# Enable GPU acceleration
poetry run python -m vibes_camera.camera --use-gpu
# Show all options
poetry run python -m vibes_camera.camera --helpTo enable Discord DM alerts when people are detected, you need to set up a Discord bot.
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section and click "Add Bot"
- Copy the Bot Token (keep this secret!)
- Under "Privileged Gateway Intents", enable Message Content Intent
- In Discord, go to Settings → Advanced → Enable Developer Mode
- Right-click on your username and select "Copy User ID"
If you want the bot to share a server with you (recommended for reliability):
- Go to OAuth2 → URL Generator
- Select scopes:
bot - Select permissions:
Send Messages,Attach Files - Copy the generated URL and open it to invite the bot to your server
Note: The bot can also send DMs directly if you have DMs open from server members.
# Copy the example file
cp .env.example .env
# Edit .env with your credentialsRequired variables in .env:
DISCORD_BOT_TOKEN=your_bot_token
DISCORD_USER_ID=your_user_id# Enable alerts with default 5-minute cooldown
poetry run python -m vibes_camera.camera --alerts
# Custom cooldown (e.g., 60 seconds)
poetry run python -m vibes_camera.camera --alerts --cooldown 60
# Combined with other options
poetry run python -m vibes_camera.camera -c 0 --alerts --cooldown 120 --use-gpu| Option | Description |
|---|---|
-c, --camera N |
Use camera index N (skips interactive selection) |
--use-gpu |
Enable GPU acceleration (OpenCL) |
--alerts |
Enable Discord DM alerts when people are detected |
--cooldown N |
Minimum seconds between alerts (default: 300) |
-h, --help |
Show help message |
- Press
qto quit the application
- Alerts trigger only when detection goes from 0 people → 1+ people
- A cooldown period prevents alert spam (default: 5 minutes)
- Each alert includes:
- Timestamp
- Number of people detected
- Captured image with detection boxes
MIT