Skip to content

MilBia/IS-GOAT-BURNING

Repository files navigation

Is the Gävle Goat Burning?

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.

Project Overview

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.

Features

  • 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.

Prerequisites

  • Python 3.8 or higher
  • Docker (optional, for Docker deployment)

INSTALLATION

  1. Clone the repository:

    git clone <repository-url>
    cd burning-goat-detection
  2. Install dependencies

    pip install -r requirements.txt

CONFIGURATION

  1. Create a .env file by copying the example:

    cp .env.example .env
  2. 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 requires VIDEO_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 to false is necessary.

HOW TO RUN

Usage Python Directly:

  1. Run the project

    python burning_goat_detection.py

Use Docker:

  1. Build the Docker image:

    docker build -t burning_goat_detection .
  2. 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.

  1. Start/Stop existing container
    docker start burning_goat_detection_container
    docker stop burning_goat_detection_container

SOURCES

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

CODING STANDARD

We use pre-commit with ruff to ensure consistent code formatting and linting.

Setup:

  1. Install pip install -r requirements_dev.txt
  2. Activate hooks: pre-commit install
  3. 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! 🐐🔥

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages