- Capture screen activity at custom intervals.
- Analyze screen captures for distracting activities using AI models.
- Display visual and audio alerts for detected distractions.
- Track statistics of distractions and activities.
- Customizable activities and alert settings.
Clone the repository to your local machine:
git clone https://github.com/DerekLiu35/ai-monitoring.git
cd ai-monitoring
- Python 3.7+
- PIP (Python package manager)
To keep your project dependencies organized and avoid potential conflicts with other Python projects, it's recommended to use a Python virtual environment (venv
) (or conda). Here’s how to set up and activate a virtual environment before installing dependencies.
In the project directory, run:
python3 -m venv venv
This will create a new folder named venv
containing a local Python environment.
Then,
-
On macOS/Linux:
source venv/bin/activate
-
On Windows:
.\venv\Scripts\activate
After activation, you’ll see (venv)
at the beginning of your command prompt, indicating that the virtual environment is active.
With the virtual environment activated, install the project dependencies using:
pip3 install -r requirements.txt
This application uses AI models to analyze screen captures and determine if the user is engaged in distracting activities. The current setup supports two model options:
-
Gemini Model:
- Model Name:
gemini-1.5-flash-latest
- This model is available via the Google Gemini API. For more accurate analysis, Gemini is recommended.
- Configuration: Add your Gemini API key to the
.env
file as follows:GEMINI_API_KEY=your_gemini_api_key_here
- Model Name:
-
LLaVA Model via Ollama:
- Ollama provides a straightforward way to run LLaVA on a local machine without needing an external API, enhancing privacy.
- Setup: Install Ollama at Ollama's official site. Once installed, run Ollama to serve LLaVA as follows:
ollama run llava
- Endpoint: Ollama will create an endpoint at
http://localhost:11434
, which the application uses to interact with the LLaVA model.
To start the application, execute:
python app.py
- Set the interval, activities, and blacklisted words in the settings.
- Click "Start Monitoring" to begin.
- The app will periodically capture the screen, analyze activities, and alert you if you’re distracted.
- Audio Alerts: Ensure the
Radar.mp3
file (or your custom audio) is available in the directory specified inconfig.json
.
- Screen Capture Issues: Ensure you have the correct permissions and screen capture software.
- Audio Alerts: Ensure audio files are accessible and compatible with
playsound
.