This project is a web application that connects to an RTSP live video stream, displays it on the frontend, and analyzes the last frame to detect the presence of smoke and/or fire. The results, including probability scores for each category, are displayed in real-time on the frontend.
- Real-time video streaming from an RTSP or HTTP (JPG/MJPEG) source.
- Fire and smoke detection using a pre-trained deep learning model.
- Real-time display of detection results with probability scores.
- User-configurable threshold for highlighting detection results.
- User-configurable analysis framerate.
- Webhook Notifications: Send alerts to a configurable webhook URL (e.g., Discord) upon detection, including detection scores and the triggering image frame.
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Install dependencies:
pip install -r backend/requirements.txt
-
Configure Webhook (Optional): Create a
.envfile in the project root and add your webhook URL:WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id/your-webhook-tokenReplace with your actual Discord webhook URL or any other webhook endpoint.
-
Start the backend server:
uvicorn backend.main:app --reload --port 5000
-
Open the frontend: Open
localhost:5000in your web browser.
This is the recommended way to run the application on a server.
-
Prerequisites:
- Docker and Docker Compose must be installed on your server.
-
Create
.envfile: If you haven't already, create a.envfile in the project root. This is where you'll put your webhook URL.nano .env
Add your webhook URL:
WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-url -
Build and Run: From the project root, run the following command:
docker-compose up --build -d
The
-dflag runs the application in the background. -
Access the Application: Open a web browser and navigate to
http://<your_server_ip>:5000. -
To Stop:
docker-compose down
- The live video stream will be displayed on the page.
- The detection results (Normal, Smoke, Fire) will be displayed with their probability scores in percentages.
- You can adjust the detection threshold using the slider. Categories with scores above the threshold will be highlighted (Fire/Smoke in red/grey, Normal in green).
- If configured, webhook notifications will be sent to your specified URL upon detection.
- You can use the built-in demo stream suggestions for quick testing.
- Here is a screenshot of the application in action:
