This project monitors the Gävle Goat webcam feed to detect if the goat is on fire. It uses computer vision techniques to analyze the video feed and sends email and/or discord notifications if fire is detected.
The Gävle Goat is a giant straw goat built annually in Gävle, Sweden. It has become a tradition for vandals to attempt to burn it down. This project aims to provide real-time monitoring of the goat's status.
- Real-time Fire Detection: Utilizes computer vision to analyze the live webcam feed for signs of fire.
- Email Notifications: Sends email alerts immediately upon detecting fire, notifying designated recipients.
- Configurable Monitoring: Allows adjustment of monitoring frequency to control resource usage and sensitivity.
- Dockerized Deployment: Easily deployable with Docker, ensuring consistent performance across different environments.
- Python 3.8 or higher
- Docker (optional, for Docker deployment)
-
Clone the repository:
git clone <repository-url> cd burning-goat-detection
-
Install dependencies
pip install -r requirements.txt
-
Create a
.env
file by copying the example:cp .env.example .env
-
Edit the .env file and fill in your configuration details:
SOURCE="https://youtu.be/vDFPpkp9krY" # URL of the webcam feed USE_EMAILS=true # Set to true if you want email notifications SENDER="[email protected]" # Your email address SENDER_PASSWORD="your_email_password" # Your email password or an app password for Gmail RECIPIENTS="[email protected],[email protected]" # Comma-separated list of email addresses to notify EMAIL_HOST="smtp.gmail.com" # Your email host (e.g., smtp.gmail.com) EMAIL_PORT=587 # Your email port (e.g., 587 for Gmail) USE_DISCORD=true # Set to true if you want Discord notifications DISCORD_HOOKS="/webhooks/webhooks/{webhook.id}/{webhook.token}" # Your discord webhook LOGGING=true # Enable or disable logging VIDEO_OUTPUT=true # Display detected video frames (true) or not (false) CHECKS_PER_SECOND=1.0 # How many times to check per second (adjust for performance) OPEN_CL=false # Enable or disable use of OpenCL for faster processing (experimental)
Important:
- OpenCL (
OPEN_CL=true
) for faster processing is experimental and requiresVIDEO_OUTPUT=false
. - OpenCL (
OPEN_CL=true
) is currently not supported in Docker containers. - For Gmail, it's often necessary to generate an app password in your Google account settings, instead of your regular password.
- When using Docker, setting
VIDEO_OUTPUT
tofalse
is necessary.
-
Run the project
python burning_goat_detection.py
-
Build the Docker image:
docker build -t burning_goat_detection .
-
Run the Docker container:
docker run --name burning_goat_detection_container -d burning_goat_detection
This command will build the image, and run the container in the background, named burning_goat_detection_container
.
- Start/Stop existing container
docker start burning_goat_detection_container docker stop burning_goat_detection_container
- Gävle Goat - Information about the Gävle Goat.
- VidGear - A video processing framework.
- yt-dlp - A youtube-dl fork with additional features.
- Fire Detection System - The core computer vision logic for fire detection.
- Python Email Examples - Example on email sending using python
Contributions are welcome! Please open an issue or submit a pull request.
We use pre-commit
with ruff
to ensure consistent code formatting and linting.
Setup:
- Install
pip install -r requirements_dev.txt
- Activate hooks:
pre-commit install
- Run checks:
pre-commit run --all-files
How to contribute
- Ensure you have set up your pre-commit hooks.
Let's keep the Gävle Goat on check! 🐐🔥