An AI-powered computer vision application built with Streamlit, OpenCV, and a custom-trained YOLO model to analyze retail surveillance videos. The system detects cash drawer state (OPEN / CLOSED) and theft events, while automatically capturing evidence frames.
👉 Try the app:
https://theft-detection-system.streamlit.app/
This application performs intelligent video analysis to:
✔ Detect cash drawer activity
✔ Recognize drawer OPEN / CLOSED state
✔ Identify theft events
✔ Display real-time detection results
✔ Automatically save evidence frames
Designed as an AI/ML + Computer Vision project for retail security and loss prevention research.
- 🧠 Custom YOLO object detection model
- 🗄 Drawer state detection (Open / Closed)
- 🚨 Theft event detection
- 📸 Automatic evidence frame capture
- 🎥 Video upload & processing
- 🌐 Interactive Streamlit web interface
- Python
- Streamlit
- OpenCV (Headless)
- Ultralytics YOLO
- NumPy
- Pandas
- PyTorch
TheftDetectionSystem/
│── app.py
│── requirements.txt
│── runtime.txt
│── models/
│ └── best2.pt
│── evidence/ (generated at runtime)
Clone the repository:
git clone https://github.com/darshil2032007/theft-detection-system.git
cd theft-detection-systemCreate virtual environment:
python -m venv venv
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun the Streamlit app:
streamlit run app.py1️⃣ Launch the app
2️⃣ Upload a retail surveillance video
3️⃣ Click Start Detection
4️⃣ View drawer & theft detection results
5️⃣ Evidence frames saved automatically
- Framework: Ultralytics YOLO
- Custom-trained for:
- Drawer detection
- Theft detection
Ensure model file exists:
models/best2.pt
When theft is detected:
✔ Frame saved automatically
✔ Cooldown prevents duplicate saves
✔ Stored in /evidence folder
This application can be deployed using:
✔ Streamlit Community Cloud
✔ Render
✔ Railway
✔ VPS / Cloud VM
- Uses
opencv-python-headlessfor cloud compatibility - Evidence folder is runtime-generated
- Streamlit Cloud storage is temporary (ephemeral)
Darshil Savaliya
This project is intended for academic / demonstration purposes.