Fire detection

Real-time fire detection: identifying real flames, instant alerts.

What it does

My app is a real-time fire detection system that utilizes a webcam feed to monitor an environment for potential fire hazards. The app is built with Streamlit for a user-friendly interface and OpenCV for handling the webcam stream. The core functionality involves capturing images from the webcam, encoding them, and then sending them to a custom Assistant class that uses the Gemini API, specifically the Google Generative AI model (`gemini-1.5-flash-latest`), to analyze the images.

The Assistant class constructs a prompt instructing the AI model to determine whether the image contains a real fire, explicitly ignoring any fire-like visuals from photos or videos. The AI model is integrated through LangChain's prompt templates and message history handling, allowing it to analyze images in context.

If the model detects a fire, the app immediately warns the user by displaying an alert on the interface. The app continuously monitors the webcam feed, updating every few seconds, ensuring timely detection of any real fire threats in the monitored environment. This system can be valuable in various scenarios, such as monitoring homes, offices, or public spaces, providing an additional layer of safety and early warning.

Built with

  • None

Team

By

Akram Khan

From

India