diff --git a/teamTechTitans/facial-landmarks-recognition b/teamTechTitans/facial-landmarks-recognition
new file mode 160000
index 0000000..d37b6a7
--- /dev/null
+++ b/teamTechTitans/facial-landmarks-recognition
@@ -0,0 +1 @@
+Subproject commit d37b6a7426e98094e28fa99254e270a3e9b6d591
diff --git a/teamTechTitans/techtitans/db.sqlite3 b/teamTechTitans/techtitans/db.sqlite3
new file mode 100644
index 0000000..5178b7a
Binary files /dev/null and b/teamTechTitans/techtitans/db.sqlite3 differ
diff --git a/teamTechTitans/techtitans/manage.py b/teamTechTitans/techtitans/manage.py
new file mode 100644
index 0000000..80363c5
--- /dev/null
+++ b/teamTechTitans/techtitans/manage.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+ """Run administrative tasks."""
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techtitans.settings')
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
+ execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/teamTechTitans/techtitans/techapp/__init__.py b/teamTechTitans/techtitans/techapp/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/__init__.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/__init__.cpython-312.pyc
new file mode 100644
index 0000000..1c46a10
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/__init__.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/admin.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/admin.cpython-312.pyc
new file mode 100644
index 0000000..d874a70
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/admin.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/apps.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/apps.cpython-312.pyc
new file mode 100644
index 0000000..382cf31
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/apps.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/models.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/models.cpython-312.pyc
new file mode 100644
index 0000000..06ffeaf
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/models.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/urls.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/urls.cpython-312.pyc
new file mode 100644
index 0000000..c68451a
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/urls.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/views.cpython-312.pyc b/teamTechTitans/techtitans/techapp/__pycache__/views.cpython-312.pyc
new file mode 100644
index 0000000..eb24e8d
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/__pycache__/views.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/__pycache__/views.py b/teamTechTitans/techtitans/techapp/__pycache__/views.py
new file mode 100644
index 0000000..8d4c0e3
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/__pycache__/views.py
@@ -0,0 +1,31 @@
+from django.shortcuts import render
+
+# yourappname/views.py
+
+# yourappname/views.py
+
+from django.http import JsonResponse
+from subprocess import Popen, PIPE
+from django.views.decorators.csrf import csrf_exempt
+import os
+
+@csrf_exempt
+def execute_script(request):
+ if request.method == 'POST':
+ try:
+ # Specify the path to your main.py script
+ script_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'hackathon', 'newMain.py')
+
+ # Execute the script
+ process = Popen(['python', script_path], stdout=PIPE, stderr=PIPE)
+ stdout, stderr = process.communicate()
+
+ # Check the result
+ if process.returncode == 0:
+ return JsonResponse({'success': True, 'message': 'Script executed successfully', 'output': stdout.decode()})
+ else:
+ return JsonResponse({'success': False, 'message': 'Error executing script', 'error': stderr.decode()}, status=500)
+ except Exception as e:
+ return JsonResponse({'success': False, 'message': str(e)}, status=500)
+ else:
+ return JsonResponse({'success': False, 'message': 'Invalid request method'}, status=400)
diff --git a/teamTechTitans/techtitans/techapp/admin.py b/teamTechTitans/techtitans/techapp/admin.py
new file mode 100644
index 0000000..8c38f3f
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/teamTechTitans/techtitans/techapp/apps.py b/teamTechTitans/techtitans/techapp/apps.py
new file mode 100644
index 0000000..3f8fdbf
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/apps.py
@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class TechappConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'techapp'
diff --git a/teamTechTitans/techtitans/techapp/migrations/__init__.py b/teamTechTitans/techtitans/techapp/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/teamTechTitans/techtitans/techapp/migrations/__pycache__/__init__.cpython-312.pyc b/teamTechTitans/techtitans/techapp/migrations/__pycache__/__init__.cpython-312.pyc
new file mode 100644
index 0000000..5f9f73b
Binary files /dev/null and b/teamTechTitans/techtitans/techapp/migrations/__pycache__/__init__.cpython-312.pyc differ
diff --git a/teamTechTitans/techtitans/techapp/models.py b/teamTechTitans/techtitans/techapp/models.py
new file mode 100644
index 0000000..71a8362
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/teamTechTitans/techtitans/techapp/newMain2.py b/teamTechTitans/techtitans/techapp/newMain2.py
new file mode 100644
index 0000000..efb25c2
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/newMain2.py
@@ -0,0 +1,183 @@
+
+
+
+import cv2
+import numpy as np
+import dlib
+from imutils import face_utils
+
+
+# Initialize dlib's face detector and facial landmark predictor
+def mainfunction():
+ p = "shape_predictor_68_face_landmarks.dat"
+ detector = dlib.get_frontal_face_detector()
+ predictor = dlib.shape_predictor(p)
+
+ # Initialize variables
+ sleep, drowsy, active = 0, 0, 0
+ status, color = "", (0, 0, 0)
+
+ def compute(ptA, ptB):
+ return np.linalg.norm(ptA - ptB)
+
+ def blinked(a, b, c, d, e, f):
+ up = compute(b, d) + compute(c, e)
+ down = compute(a, f)
+ ratio = up / (2.0 * down)
+
+ if ratio > 0.25:
+ return 2
+ elif 0.21 < ratio <= 0.25:
+ return 1
+ else:
+ return 0
+
+ # Open a video capture object
+ cap = cv2.VideoCapture(0)
+
+ # Check if the video capture is opened successfully
+ if not cap.isOpened():
+ print("Error: Could not open camera.")
+ exit()
+
+ while True:
+ _, frame = cap.read()
+ if frame is None:
+ print("Error: Could not read frame.")
+ break
+
+ gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
+
+ # Detect faces in the grayscale image
+ faces = detector(gray, 0)
+
+ for face in faces:
+ x1, y1, x2, y2 = face.left(), face.top(), face.right(), face.bottom()
+
+ face_frame = frame.copy()
+ cv2.rectangle(face_frame, (x1, y1), (x2, y2), (0, 255, 0), 2)
+
+ landmarks = predictor(gray, face)
+ landmarks = face_utils.shape_to_np(landmarks)
+
+ left_blink = blinked(landmarks[36], landmarks[37], landmarks[38], landmarks[41], landmarks[40], landmarks[39])
+ right_blink = blinked(landmarks[42], landmarks[43], landmarks[44], landmarks[47], landmarks[46], landmarks[45])
+
+ if left_blink == 0 or right_blink == 0:
+ sleep += 1
+ drowsy, active = 0, 0
+ if sleep > 6:
+ status, color = "SLEEPING !!!", (255, 0, 0)
+ elif 0 < left_blink == 1 or right_blink == 1:
+ drowsy += 1
+ sleep, active = 0, 0
+ if drowsy > 6:
+ status, color = "Drowsy !", (0, 0, 255)
+ else:
+ active += 1
+ sleep, drowsy = 0, 0
+ if active > 6:
+ status, color = "Active :)", (0, 255, 0)
+
+ cv2.putText(frame, status, (100, 100), cv2.FONT_HERSHEY_SIMPLEX, 1.2, color, 3)
+
+ for (x, y) in landmarks:
+ cv2.circle(face_frame, (x, y), 1, (255, 255, 255), -1)
+
+ cv2.imshow("Frame", frame)
+ cv2.imshow("Result of detector", face_frame)
+
+ key = cv2.waitKey(1)
+ if key == 27:
+ break
+
+ # Release the video capture object and close all OpenCV windows
+ cap.release()
+ cv2.destroyAllWindows()
+
+
+# p = "shape_predictor_68_face_landmarks.dat"
+# detector = dlib.get_frontal_face_detector()
+# predictor = dlib.shape_predictor(p)
+
+# # Initialize variables
+# sleep, drowsy, active = 0, 0, 0
+# status, color = "", (0, 0, 0)
+
+# def compute(ptA, ptB):
+# return np.linalg.norm(ptA - ptB)
+
+# def blinked(a, b, c, d, e, f):
+# up = compute(b, d) + compute(c, e)
+# down = compute(a, f)
+# ratio = up / (2.0 * down)
+
+# if ratio > 0.25:
+# return 2
+# elif 0.21 < ratio <= 0.25:
+# return 1
+# else:
+# return 0
+
+# # Open a video capture object
+# cap = cv2.VideoCapture(0)
+
+# # Check if the video capture is opened successfully
+# if not cap.isOpened():
+# print("Error: Could not open camera.")
+# exit()
+
+# while True:
+# _, frame = cap.read()
+# if frame is None:
+# print("Error: Could not read frame.")
+# break
+
+# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
+
+# # Detect faces in the grayscale image
+# faces = detector(gray, 0)
+
+# for face in faces:
+# x1, y1, x2, y2 = face.left(), face.top(), face.right(), face.bottom()
+
+# face_frame = frame.copy()
+# cv2.rectangle(face_frame, (x1, y1), (x2, y2), (0, 255, 0), 2)
+
+# landmarks = predictor(gray, face)
+# landmarks = face_utils.shape_to_np(landmarks)
+
+# left_blink = blinked(landmarks[36], landmarks[37], landmarks[38], landmarks[41], landmarks[40], landmarks[39])
+# right_blink = blinked(landmarks[42], landmarks[43], landmarks[44], landmarks[47], landmarks[46], landmarks[45])
+
+# if left_blink == 0 or right_blink == 0:
+# sleep += 1
+# drowsy, active = 0, 0
+# if sleep > 6:
+# status, color = "SLEEPING !!!", (255, 0, 0)
+# elif 0 < left_blink == 1 or right_blink == 1:
+# drowsy += 1
+# sleep, active = 0, 0
+# if drowsy > 6:
+# status, color = "Drowsy !", (0, 0, 255)
+# else:
+# active += 1
+# sleep, drowsy = 0, 0
+# if active > 6:
+# status, color = "Active :)", (0, 255, 0)
+
+# cv2.putText(frame, status, (100, 100), cv2.FONT_HERSHEY_SIMPLEX, 1.2, color, 3)
+
+# for (x, y) in landmarks:
+# cv2.circle(face_frame, (x, y), 1, (255, 255, 255), -1)
+
+# cv2.imshow("Frame", frame)
+# cv2.imshow("Result of detector", face_frame)
+
+# key = cv2.waitKey(1)
+# if key == 27:
+# break
+
+# # Release the video capture object and close all OpenCV windows
+# cap.release()
+# cv2.destroyAllWindows()
diff --git a/teamTechTitans/techtitans/techapp/templates/project.html b/teamTechTitans/techtitans/techapp/templates/project.html
new file mode 100644
index 0000000..c4ba376
--- /dev/null
+++ b/teamTechTitans/techtitans/techapp/templates/project.html
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+ Tech Titans
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Face detection model
+
+
+
+
+
+
Solution description
+
+
+
Creating an effective online learning environment involves not only delivering
+ content but
+ also ensuring active student engagement. To enhance this interaction, incorporating head movement
+ tracking
+ into the web camera becomes a valuable tool. By leveraging computer vision technologies, we can detect
+ and
+ monitor students' presence during online classes in real-time. This feature not only helps educators
+ ensure
+ that students are actively participating but also provides insights into their level of engagement.
+
+ content covered in previous classes. This serves as a reinforcement mechanism, promoting the retention
+ of
+ information and encouraging students to stay mentally active during the entire session.
+
+
+
+
+ In essence, the integration of head movement tracking and the incorporation of spontaneous MCQs
+ contribute
+ to the creation of a dynamic and engaging virtual classroom. These features not only serve the practical
+ purpose of ensuring student presence but also enhance the overall educational experience by promoting
+ active
+ participation and reinforcing learning outcomes. As technology continues to evolve, such innovative
+ approaches play a pivotal role in shaping the future of online education, making it more interactive,
+ personalized.