How rohangforwork/opencv_attendence works
Project Type and Purpose
• The project is an automated attendance registry that uses computer vision technologies.
• It primarily uses OpenCV for frontal face detection/recognition but has been updated to incorporate YOLO v8 (and related YOLO v9 scripts) for object detection enhancements.
• The system appears designed as a full-stack application with a web interface (templates and static assets), a backend server (server.py, server1.py, serverThread.py), and a vision component (contained in the "front_face" and "yolo_v9" directories).
Key File Structure Components
• Frontend/UI Layer:
• The "templates" directory (with index.html) represents the web pages.
• The "static" directory contains CSS and JS resources.
• Backend/Server Layer:
• server.py, server1.py, and serverThread.py indicate a server component that likely handles API calls, user interactions, and coordination between UI and vision modules.
• Computer Vision Modules:
• "front_face": Contains scripts (e.g., face_detect.py, face_recognition.py, record_faces.py) and model files (e.g., haar_face.xml, face_trained.yml) for OpenCV-based face recognition.
• "yolo_v9": Contains training (train.py), prediction (predict.py), and utilities (rename.py, txt_gen.py, video_yolo_trans.py) for the YOLO-based detection system.
• Model weights include YOLO files (yolo11n.pt, yolov8n.pt, yolov8n-cls.pt) and additional data files like shape_predictor_68_face_landmarks.dat.
• Data and Resources:
• Attendance.xlsx and class_timetable.xlsx likely store attendance records and scheduling information.
• The "persons" directory organizes face data per individual (hrudhay, rajat, rohan etc.) used for training or recognition.
• Numpy files (features.npy, labels.npy) are used to store extracted features/labels for face recognition.
How
• Next, illustrate the “Backend/Server” component:
• “Computer Vision” layer as two main subcomponents:
a. OpenCV Face Recognition Module:
• Components such as face_detect.py, face_recognition.py, record_faces.py.
• Supporting elements like the Haar cascade file (haar_face.xml), face_trained.yml, and numpy data (features.npy, labels.npy).
b. YOLO Detection Module:
• Components from the "yolo_v9" directory (train.py, predict.py, etc.) alongside the YOLO model weights files (yolo11n.pt, yolov8n.pt, and yolov8n-cls.pt).
• A “Data Storage / Resources” block:
• Excel files (ATTENDANCE.xlsx, class_timetable.xlsx) and the "persons" directory.
• How these serve as persistent data for attendance records and training data.
• External dependency nodes if necessary:
Relationships and Data Flow
• Optionally, illustrate a training/feedback loop for periodic model retraining (data from the "persons" directory feeding into the YOLO training pipeline).
Final Checklist
• Clear and descriptive labels for each component.
• Annotations if necessary to denote the use of specific technologies/frameworks (e.g., “OpenCV + Dlib”, “YOLO v8/v9”, “Flask/Django” if applicable from server code hints, and “Excel” for record keeping).