An automated bot that monitors Norwegian traffic cameras for yellow cars and posts them to Bluesky with the classic Norwegian phrase "GUL BIL!" (Yellow Car!).
- Downloads images from 814 Norwegian traffic cameras
- Detects vehicles using YOLO26 real-time object detection
- Validates yellow color using HSV filtering for accurate yellow car detection
- Posts to Bluesky with "GUL BIL!" and annotated bounding boxes when a yellow car is found
Note: This bot has been migrated from GPT-4o/OWLv2 (cloud-based AI) to YOLO26 (local inference) for improved speed, cost-efficiency, and reliability. YOLO26 provides ~50x faster detection (100-200ms vs 5-10s per image) while maintaining high accuracy.
- Fair Processing: Shuffles camera order to ensure all cameras get processed at different times of day
- Budget Optimized: Designed to stay within GitHub Actions' 2000 minutes/month limit
- Rate Limit Aware: Gracefully handles API rate limiting
- Persistent State: Remembers progress between runs
- Statistics Tracking: Monitors detection rates and posting success
your-repo/
βββ gulbilbot.py
βββ pyproject.toml
βββ valid_webcam_ids.txt
βββ .github/
β βββ workflows/
β βββ post.yml
β βββ update-dummy-md.yml
βββ README.md
pyproject.toml and requirements.txt:
requests
python-dotenv
torch
torchvision
Pillow
atproto
ultralytics
opencv-python-headless
numpyrequirements.txt:
torch==2.13.0
torchvision==0.28.0
requests
python-dotenv
atproto
Pillow
ultralytics
opencv-python-headless
numpyvalid_webcam_ids.txt: One traffic camera URL per line (814 URLs total). Example:
https://webkamera.atlas.vegvesen.no/public/kamera?id=3000063_1
https://webkamera.atlas.vegvesen.no/public/kamera?id=3001004_1
...
Set up these secrets in your repository (Settings β Secrets and variables β Actions):
BSKY_HANDLE: Your Bluesky handle (e.g.,username.bsky.social)BSKY_PASSWORD: Your Bluesky app password (not your main password!)
Note: No API tokens required! YOLO26 runs locally on GitHub Actions runners.
- Go to Settings β Privacy and Security β App Passwords
- Create a new app password for this bot
- Use this password (not your main password) in the
BSKY_PASSWORDsecret
Edit these variables in gulbilbot.py:
CONF_THRESHOLD = 0.3 # YOLO26 vehicle detection confidence (lower = more sensitive)
YELLOW_RATIO_THRESHOLD = 0.15 # Minimum ratio of yellow pixels to confirm yellow car
SAMPLE_SIZE = 100 # Number of images to test per runSupported Vehicle Types: car, truck, bus, van, threewheel
The bot runs 3 times per day:
- 6:00 AM UTC
- 2:00 PM UTC
- 10:00 PM UTC
Budget: ~60 minutes/day, ~1800 minutes/month (within 2000 limit)
Coverage: 300 random cameras per run, all 814 cameras covered every ~3 runs
Each run tracks:
- Images downloaded successfully
- Yellow cars detected
- Successful Bluesky posts
- Processing time
- Results saved to
test_results.txt
Two-stage process:
-
YOLO26 Object Detection:
- Detects vehicles in real-time using YOLO26n (Nano variant)
- Identifies: cars, trucks, buses, vans, and threewheels
- Confidence threshold: 0.3 (30%)
- Processing speed: 100-200ms per image
- ~50x faster than previous cloud-based approach
-
HSV Color Validation:
- Validates detected vehicle contains sufficient yellow pixels
- HSV Range: Hue=[15-35], Saturation=[80-255], Value=[80-255]
- Minimum yellow pixel ratio: 15%
- Eliminates false positives from non-yellow vehicles
-
Bounding Box Annotation:
- Draws bright yellow rectangles around detected yellow cars
- Labels include vehicle type and confidence score
- Annotated images posted directly to Bluesky
"Rate limit reached":
- Bot automatically stops to preserve GitHub Actions minutes
- Will resume in next scheduled run
"Shuffle state not found":
- Normal on first run
- Bot will create new shuffle and start processing
"No yellow cluster detected":
- Most images won't have yellow cars - this is normal
- Adjust
YELLOW_THRESHOLDif too sensitive/insensitive
Check workflow logs for:
- Processing progress
- Detection statistics
- Error messages
- Session summaries
Trigger a manual run:
- Go to Actions tab
- Select "Yellow Car Bot - Budget Optimized"
- Click "Run workflow"
gulbilbot.py: Main bot script (downloads 300 random images, detects yellow cars, posts to Bluesky)pyproject.toml: Python dependenciesrequirements.txt: Pinned runtime dependencies for pip-based installsvalid_webcam_ids.txt: List of 814 traffic camera URLs.github/workflows/post.yml: GitHub Actions workflow for the main bot run.github/workflows/update-dummy-md.yml: GitHub Actions workflow (updatesdummy.mdweekly)test_results.txt: Results from latest run (auto-generated)
- Only processes public traffic camera feeds
- No personal data collected or stored
- Images deleted immediately after processing
- Respects API rate limits and terms of service
Feel free to:
- Adjust detection parameters for better accuracy
- Add more traffic cameras to the list
- Improve the yellow detection algorithm
- Enhance error handling
This project is for educational and entertainment purposes. Please respect:
- Traffic camera usage terms
- Bluesky community guidelines
- API rate limits and quotas
Lykke til med GUL BIL-jakten! π