The AI Surveillance System is a project designed to provide automated surveillance capabilities using artificial intelligence. This system utilizes image-to-text processing to describe images and detect the presence of individuals within camera frames. Upon detecting a person, the system initiates a 5-second video recording and generates a security log file containing the date and time of the event. The security log file is produced by employing our locally hosted Large Language Model (LLM) from LM Studio, which initializes a local HTTP server emulating the operations of OpenAI's API. Addtionally, a Telegram Bot has been deployed to facilitate a more user-friendly interface and control over the system.
- Image-to-text processing for image description using moondream1 (Built by @vikhyatk using SigLIP, Phi-1.5 and the LLaVa training dataset)
- Person detection within camera frames
- Automated 5-second video recording upon person detection
- Generation of security log files with date and time stamps
- Local HTTP server simulation of OpenAI's API behavior
- Utilization of local Large Language Model (LLM) for security log file generation
- Integration with Telegram Bot for user access and interaction
- Telegram Bot functions include:
- Starting the surveillance server
- Checking real-time camera feed
To get started with the AI Surveillance System, follow these steps:
-
Clone the Repository:
git clone https://github.com/YouXuan2010/AI-Surveillance-System-with-Chatbot.git
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Telegram Bot:
- Obtain a Telegram Bot token from the BotFather.
- Create .env file under the project directory:
TELEGRAM_BOT_TOKEN=XXXXXXXXXXX
-
Setup Camera and LM Studio server:
- Download IP Webcam from Playstore (Only tested using Android phone, Apple user can find others)
- Start camera server and update stream_url in aiss.py
- Install LM Studio and download any LLM model from HuggingFace Model Hub
- Start your local LLM server and update the base_url in aiss.py
-
Run the System:
python telebot.py
-
Access the Telegram Bot:
- Search for your Telegram Bot by its username.
- Interact with your Bot to start the surveillance server and check real-time camera feed.
The camera will process the image and detect if there's any people in the image
For example at some point, the camera captured this:
The image-to-text model will detect the presence of people and then imform the user via telegram app:
The security log will be saved in the Security_Logs.txt for future references:
Contributions are welcome! If you'd like to contribute to the AI Surveillance System, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/new-feature
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries or feedback regarding the AI Surveillance System, please contact ME.