kkt-2002 commited on
Commit
8ae42d2
·
1 Parent(s): 6d7df9f
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .env
Dockerfile DELETED
@@ -1,20 +0,0 @@
1
- FROM python:3.10-slim
2
-
3
- WORKDIR /app
4
-
5
- # Create user
6
- RUN useradd -m -u 1000 user
7
-
8
- # Copy requirements
9
- COPY --chown=user requirements.txt .
10
-
11
- # Install Python packages
12
- RUN pip install --no-cache-dir --upgrade pip
13
- RUN pip install --no-cache-dir -r requirements.txt
14
-
15
- # Copy application files
16
- COPY --chown=user . .
17
- USER user
18
-
19
- EXPOSE 7860
20
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,44 +0,0 @@
1
- ---
2
- title: Face Recognition Attendance System
3
- emoji: 👤
4
- colorFrom: blue
5
- colorTo: green
6
- sdk: docker
7
- app_port: 7860
8
- pinned: false
9
- ---
10
-
11
- # Face Recognition Attendance System
12
-
13
- A comprehensive face recognition attendance system with anti-spoofing capabilities.
14
-
15
- ## Features
16
-
17
- - Student and teacher registration with face capture
18
- - Face recognition login system
19
- - Real-time liveness detection (anti-spoofing)
20
- - Attendance marking with face verification
21
- - Metrics dashboard with analytics
22
- - MongoDB integration for data persistence
23
-
24
- ## Usage
25
-
26
- 1. **Register**: Create account as student or teacher with face capture
27
- 2. **Login**: Use credentials or face recognition
28
- 3. **Mark Attendance**: Students can mark attendance with live face verification
29
- 4. **Dashboard**: View attendance records and system metrics
30
-
31
- ## Technology Stack
32
-
33
- - **Backend**: Flask (Python)
34
- - **Computer Vision**: OpenCV, dlib, YOLO
35
- - **Machine Learning**: ONNX Runtime for model inference
36
- - **Database**: MongoDB
37
- - **Deployment**: Docker on Hugging Face Spaces
38
-
39
- ## Model Files Required
40
-
41
- - `yolov5s-face.onnx` - Face detection
42
- - `AntiSpoofing_bin_1.5_128.onnx` - Liveness detection
43
- - `shape_predictor_68_face_landmarks.dat` - Facial landmarks (auto-downloaded)
44
- - `dlib_face_recognition_resnet_model_v1.dat` - Face recognition (auto-downloaded)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
The diff for this file is too large to render. See raw diff
 
app/templates/404.html DELETED
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Page Not Found</title>
5
- <style>
6
- body { font-family: Arial, sans-serif; background-color: #f9f9f9; text-align: center; padding: 50px; }
7
- h1 { font-size: 50px; color: #d9534f; }
8
- p { font-size: 20px; margin-top: 20px; }
9
- a { display: inline-block; margin-top: 30px; font-size: 18px; color: #337ab7; text-decoration: none; }
10
- a:hover { text-decoration: underline; }
11
- </style>
12
- </head>
13
- <body>
14
- <h1>404</h1>
15
- <p>Oops! The page you are looking for does not exist.</p>
16
- <a href="{{ url_for('home') }}">Go Back Home</a>
17
- </body>
18
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/templates/500.html DELETED
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Server Error</title>
5
- <style>
6
- body { font-family: Arial, sans-serif; background-color: #f9f9f9; text-align: center; padding: 50px; }
7
- h1 { font-size: 50px; color: #d9534f; }
8
- p { font-size: 20px; margin-top: 20px; }
9
- a { display: inline-block; margin-top: 30px; font-size: 18px; color: #337ab7; text-decoration: none; }
10
- a:hover { text-decoration: underline; }
11
- </style>
12
- </head>
13
- <body>
14
- <h1>500</h1>
15
- <p>Sorry! Something went wrong on our end.</p>
16
- <a href="{{ url_for('home') }}">Go Back Home</a>
17
- </body>
18
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/templates/teacher_login.html DELETED
File without changes
app/templates/teacher_register.html DELETED
File without changes
render.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ - type: web
3
+ name: attendance-system
4
+ env: python
5
+ buildCommand: pip install -r requirements.txt
6
+ startCommand: python app.py
7
+ envVars:
8
+ - key: PYTHON_VERSION
9
+ value: "3.9"
requirements.txt CHANGED
@@ -1,11 +1,12 @@
1
- flask==2.3.2
2
- opencv-python-headless==4.8.0.76
3
- dlib-bin==19.24.6
4
- onnxruntime==1.15.1
5
- imutils==0.5.4
6
  numpy==1.24.3
 
7
  requests==2.31.0
8
- python-dotenv==1.0.0
9
- pymongo==4.4.1
 
 
10
  Pillow==10.0.0
11
- gunicorn==20.1.0
 
1
+ Flask==2.3.3
2
+ pymongo==4.5.0
3
+ python-dotenv==1.0.0
4
+ opencv-python-headless==4.8.1.78
 
5
  numpy==1.24.3
6
+ onnxruntime==1.15.1
7
  requests==2.31.0
8
+ gdown==4.7.1
9
+ deepface==0.0.79
10
+ tensorflow==2.13.0
11
+ scikit-learn==1.3.0
12
  Pillow==10.0.0