A real-time object detection and person classification system using YOLOv8 and ResNet50. This application provides live video analysis with object tracking and detailed person classification.
- Real-time object detection using YOLOv8
- Person classification with attributes:
- Age groups (child, teenager, young adult, adult, elderly)
- Gender (male, female)
- Clothing (casual, formal, business)
- Activity (standing, sitting, walking, running)
- Live tracking with unique ID assignment
- Support for both webcam and video file input
- Adjustable confidence thresholds
- Multiple YOLO model options (nano to xlarge)
- Real-time statistics and session history
- Detailed classification summaries
- Clone the repository:
git clone https://github.com/GG2GG/live_detection.git
cd live_detection- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Download YOLOv8 weights:
mkdir yolov8_weights
cd yolov8_weights
wget https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt
cd ..- Start the server:
python backend/main.py- Open your browser and navigate to:
http://localhost:8000
- Use the interface to:
- Switch between webcam and video file input
- Adjust detection confidence threshold
- Select different YOLO models
- Pause/play the video feed
- View real-time statistics and classifications
- Stop inference and view final summary
live_detection/
├── backend/
│ └── main.py
├── frontend/
│ └── index.html
├── videos/
├── yolov8_weights/
├── requirements.txt
└── README.md
- Python 3.8+
- FastAPI
- OpenCV
- PyTorch
- Ultralytics YOLOv8
- Uvicorn
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.