Diagram
How it works
- Activity Monitor Lens running in Archetype platform
- Real time camera analysis. To set up your own camera, follow the RTSP setup guide
-
Curated prompting. The model is prompted in a way that it tries to minimize hallucination, and to respond following a format that we can search after. It follows a 3 step process:
- Analyze exactly what it sees in the video
- Summarize observations related to the focus area
- Decide whether to send an alert using the word Alert at the beginning.
View the instruction we use
- Response filtering. This format allows us to expect the trigger word “Alert” whenever what’s in focus is detected, so we watch for that trigger word to send alerts. That trigger word could be anything, but would need to match in both prompt and response filter.
Run the demos
Prerequisites
The instructions below assume you are following best practices and have downloaded this git repo into a parent directory at: ~/atai. If you have already installed the ATAI Python Library and cloned the cookbook repository, proceed directly to Quickstart.Install Conda
Setup dev environment
Install ATAI Python Library
Clone the Cookbook Repository
Configure RTSP Stream and Telegram Bot
- RTSP Stream: Set up your camera’s RTSP stream using the RTSP Setup Guide
- Telegram Bot: Create and configure your bot following the Bot Configuration Guide - you’ll need the bot token and chat ID
Run Demos
Demo 1: Command Line + Telegram
- Open a terminal and activate the conda environment where python_client is installed
- Navigate to
telegram-alerts/terminal_bot
-
Open the file
app.py- Add your bot token to BOT_TOKEN
- Add your chat ID to CHAT_ID
-
In the terminal:
- Run the following commands and follow the instructions:
Demo 2: Only Telegram demo
- Open a terminal and activate the conda environment where python_client is installed.
- Navigate to
telegram-alerts/bot_only.
-
Open the file
app.py- Add your bot token to BOT_TOKEN
- Add your chat ID to CHAT_ID
-
In the terminal:
- Run the following commands:
- When you run the script, you’ll receive a message in Telegram. Follow the instructions to configure your smart monitor.