Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATHIRU — AI Wildlife Intrusion Monitoring System

ATHIRU is an AI-powered wildlife intrusion monitoring system designed to reduce human–wildlife conflict in forest-adjacent communities.

The system continuously monitors CCTV camera feeds, detects wild animals using YOLO-World, captures evidence, generates real-time alerts, stores incidents in a database, and immediately notifies authorities through Telegram.


System Workflow

CCTV Camera / Demo Video
            │
            ▼
     YOLO-World Detection
            │
            ▼
 Multi-Object Tracking (YOLO)
            │
            ▼
 First Detection of Animal
            │
 ┌──────────┼───────────┐
 │          │           │
 ▼          ▼           ▼
Screenshot Database  Telegram Alert
 │          │
 ▼          ▼
FastAPI Backend
 │
 ▼
Live Dashboard Updates

Features

  • AI-powered wildlife detection using YOLO-World
  • Multi-object tracking
  • Live CCTV monitoring dashboard
  • Camera switching support
  • Automatic screenshot capture
  • Real-time incident logging
  • SQLite database storage
  • Live dashboard updates without refresh
  • Telegram alert notifications
  • Threat statistics
  • Incident history
  • Camera timestamp overlay
  • Location tagging for every alert

Tech Stack

Backend

  • FastAPI
  • SQLAlchemy
  • SQLite
  • Pydantic
  • Jinja2

AI

  • YOLO-World
  • Ultralytics
  • OpenCV

Frontend

  • HTML
  • CSS
  • JavaScript
  • Bootstrap 5
  • Leaflet.js

Notifications

  • Telegram Bot API

Project Structure

ATHIRU/

main.py
requirements.txt
.env.example
.gitignore

backend/
│
├── database.py
├── models.py
├── schemas.py
├── telegram_service.py

detector/
│
└── detect.py

video/
│
├── process_video.py
└── stream.py

templates/
│
├── base.html
├── login.html
└── dashboard.html

static/
│
├── css/
├── js/
├── screenshots/
└── videos/
    └── wildlife_demo.mp4   (place manually, see Required Files)

yolov8s-world.pt   (place manually, see Required Files)

Installation

Requires Python 3.13. The exact package versions in requirements.txt are pinned to what was tested and confirmed working on Python 3.13 - several of them (torch, numpy, opencv-python, etc.) ship version-specific prebuilt wheels, so installing on a different Python version may fail to find a matching version. If you're on a different Python version, either install Python 3.13 for this project, or relax the pins in requirements.txt (e.g. torch>=2.13.0) and let pip resolve compatible versions for your interpreter.

Requires Git. requirements.txt installs CLIP directly from its GitHub repo (YOLO-World needs it to match text class names like "elephant" to what it sees), so Git must be installed and on your PATH.

Create virtual environment

python -m venv venv

Activate

Windows

venv\Scripts\activate

Linux/Mac

source venv/bin/activate

Install packages

pip install -r requirements.txt

Required Files

Place these manually.

yolov8s-world.pt

into

project root

and

wildlife_demo.mp4

into

static/videos/

Environment Variables

Copy .env.example to .env and fill in your Telegram bot credentials:

TELEGRAM_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxx

TELEGRAM_CHAT_ID=xxxxxxxxxx

Running the Project

Start FastAPI

uvicorn main:app

Open

http://127.0.0.1:8000

Running Detection

Open another terminal

python -m video.process_video

Demo

  1. Login to dashboard.
  2. Select CAM-02 Backyard.
  3. Demo wildlife video starts.
  4. YOLO detects the animal.
  5. Screenshot is captured.
  6. Incident stored in SQLite.
  7. Dashboard updates automatically.
  8. Telegram alert is sent with screenshot.
  9. Threat statistics update instantly.

APIs

Dashboard

GET /

Dashboard Page

GET /dashboard

Health

GET /api/health

Alerts

GET /api/alerts

Statistics

GET /api/stats

Video Stream

GET /api/stream/backyard

Database

SQLite stores

  • Species
  • Confidence
  • Latitude
  • Longitude
  • Timestamp
  • Screenshot path

Alert Workflow

Animal Detected
        │
        ▼
First Detection?
        │
      Yes
        │
        ▼
Capture Screenshot
        │
        ▼
Store Alert
        │
        ▼
Update Dashboard
        │
        ▼
Send Telegram Notification

About

AI-powered wildlife intrusion monitoring system that won us our first hackathon.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages