A real-time people counting system that uses Intel RealSense camera and YOLO object detection to detect and count people in a classroom. The system also leverages accuracy and logs occupancy data for analysis.
- Real-Time People Detection and Tracking:
- Uses YOLO object detection to identify and track people in video frames.
- Depth-Based Filtering:
- Uses depth data from RealSense cameras to filter out false positives.
- Automatic Image Capture:
- Captures and saves combined images (RGB, IR, depth, and detection overlays) every 15 minutes.
- Data Logging:
- Logs occupancy data (timestamp, current count, max count) to CSV files.
- Visualization:
- Displays real-time visual feedback, including bounding boxes, counts, and detection overlays.
- Occupancy Analysis:
- Analyzes logged data to display recent occupancy statistics and generate data tables.
- Hardware:
- Intel RealSense camera (or a regular webcam).
- Software:
- Python 3.8+
- OpenCV
- Pyrealsense2
- Ultralytics YOLO
- NumPy
- MediaPipe (optional for pose detection)
- Clone the repository:
git clone https://github.com/yourusername/Counting-People-Using-Video-Camera.git
cd Counting-People-Using-Video-Camera- Install required packages:
pip install -r requirements.txt- Download YOLO model weights:
- Place the YOLO model file (e.g.,
yolov8m.pt) in the appropriate directory.
- Place the YOLO model file (e.g.,
- Run the program:
cd src
python people_counter.py- Controls:
- Press 'q' to quit the program
- Analyze logged data:
- Use the
occupancy_analysis.pyscript to analyze logged data and generate statistics:python occupancy_analysis.py
- Use the