A robust desktop application built with PyQt6 that leverages YOLO object detection to identify and track people in video streams. This project combines computer vision capabilities with a user-friendly interface for real-time person detection and works both offline and online.
Currently works on Unix-based systems, with Windows compatibility planned for future releases.
The project follows a modular Python package structure for better maintainability and extensibility:
person-detection-PyQt-yolo/
├── src/
│ └── person_detection/ # Main package
│ ├── __init__.py
│ ├── main.py # Application entry point
│ ├── core/ # Core functionality
│ │ ├── config.py # Configuration settings
│ │ └── models.py # YOLO model management
│ ├── detection/ # Detection logic
│ │ ├── detector.py # Person detection algorithms
│ │ └── camera.py # Camera management
│ ├── ui/ # User interface
│ │ ├── main_window.py # Main application window
│ │ └── video_thread.py # Video processing thread
│ ├── telegram/ # Telegram bot integration
│ │ └── bot.py # Bot functionality
│ └── database/ # Database operations
│ └── handler.py # Database management
├── run.py # Compatibility script
├── setup.py # Package installation
├── requirements.txt # Dependencies
└── README.md # This file
# Clone the repository
git clone https://github.com/Erfan-ram/person-detection-PyQt-yolo.git
cd person-detection-PyQt-yolo
# Install system dependencies
sudo apt install v4l-utils
# Install Python dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
# Run the application
person-detection# After cloning and installing dependencies
python run.py# From the project root
python -m src.person_detection.main- Real-time person detection using YOLOv8
- Modular architecture for easy maintenance and extension
- Multiple camera support with automatic detection
- Telegram bot integration for remote monitoring
- Configurable accuracy levels (0.25, 0.5, 0.75)
- Face detection within person bounding boxes
- Database management for users and settings
- Professional package structure following Python best practices
- Backward compatibility with previous versions
- GUI: PyQt6
- Computer Vision: OpenCV, YOLO v8
- Camera Utilities: v4l-utils
Before using this application, you need to install v4l-utils:
sudo apt install v4l-utilsThis utility is used to identify and configure camera devices in the system.
All Python dependencies are listed in requirements.txt and will be installed automatically with the installation methods above.
- Create a bot via @BotFather
- Get your bot token
- Run the application and go to "Bot Settings"
- Enter your bot token and admin user IDs
- Restart the application to apply changes
- Send
/panelto your bot to access controls
Looking for the original single-file version? The legacy monolithic implementation (663-line pyqt_main.py) is preserved on the old-code branch for reference and backward compatibility.
git checkout old-code # Access original pyqt_main.py
python pyqt_main.py # Run legacy versionFor detailed migration instructions, see MIGRATION.md.
The current main branch features a modern, modular architecture that's easier to maintain and extend.
See DEVELOPMENT.md for detailed development guidelines and architecture documentation.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Add facial recognition capability to identify unique individuals and track their presence over time
- Generate detailed statistics and reports for each identified person
- Full support for Windows operating systems
- Upgrade to newer YOLO versions for improved accuracy and performance
- Simultaneous monitoring from multiple camera sources
- Backup detection logs and statistics to cloud services
- Customizable notification rules based on person count, time of day, or specific individuals
- Docker containerization support
- REST API for integration with other systems ( not knowing how to do this yet )


