AI-Powered Student Engagement Monitoring System with Real-Time Analytics
Back to ProjectNavigate to the project directory in your terminal or command prompt:
cd "c:\Users\Admin\Desktop\cccoddee\students Emgaments Detection"
For Mac/Linux users, use forward slashes in the path.
For Windows:
.\venv\Scripts\activate
For Mac/Linux:
source venv/bin/activate
You should see (venv) prefix in your command prompt after activation.
Install all necessary packages using pip:
pip install -r requirements.txt
This will install Django 4.2, YOLOv8, MediaPipe, OpenCV, Celery, and all other dependencies. Installation may take 5-10 minutes.
Key packages that will be installed:
Create database tables by running migrations:
python manage.py makemigrations
python manage.py migrate
This creates tables for students, video sessions, analytics, and user authentication.
Create an admin account to access the Django admin panel:
python manage.py createsuperuser
You will be prompted to enter:
Remember these credentials - you'll need them to access the admin panel.
If deploying to production, collect all static files:
python manage.py collectstatic
For development, this step is optional.
Launch the Django development server:
python manage.py runserver
The application will be available at:
http://127.0.0.1:8000/
Keep this terminal window open while using the application.
Open your web browser and navigate to:
http://127.0.0.1:8000/admin/
Login using the superuser credentials you created in Step 5.
In the admin panel:
Accurate seating positions improve tracking accuracy.
Open engagement_monitor/settings.py to customize:
# For SQLite (default)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# For PostgreSQL (production)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'engagement_db',
'USER': 'your_username',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
DATA_UPLOAD_MAX_MEMORY_SIZE = 524288000 # 500MB
FILE_UPLOAD_MAX_MEMORY_SIZE = 524288000 # 500MB
# Process every Nth frame (higher = faster but less accurate)
PROCESS_EVERY_N_FRAMES = 5 # Default: 5
For production environments handling multiple large videos:
Windows: Download from redis.io
Mac: brew install redis
Linux: sudo apt-get install redis-server
redis-server
celery -A engagement_monitor worker -l info
This enables asynchronous video processing for better performance.
Ensure the video has good lighting and clear view of students for best results.
After uploading, you'll be redirected to the processing status page where you can:
Processing time varies based on video length and system specs. A 10-minute video typically takes 3-5 minutes.
Once processing completes, access the results dashboard to view:
From the results page, you can:
Reports include charts, statistics, and recommendations for improving engagement.
Possible Causes:
Solutions:
Solutions:
Solutions:
python manage.py collectstatic --clear
python manage.py collectstatic
Then restart the development server.
Solutions:
python manage.py makemigrations
python manage.py migrate --run-syncdb
If issues persist, delete db.sqlite3 and run migrations again (note: this will delete all data).
Solutions:
Solutions:
pip install --upgrade pip
pip install -r requirements.txt --force-reinstall
Ensure virtual environment is activated before installing packages.
Solutions:
In monitoring/detector.py, adjust detection confidence:
# Lower values = more detections (may include false positives)
# Higher values = fewer detections (more accurate)
DETECTION_CONFIDENCE = 0.5 # Range: 0.1 to 0.9
Configure email settings in settings.py for report delivery:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'your-email@gmail.com'
EMAIL_HOST_PASSWORD = 'your-app-password'
Modify monitoring/models.py to add more video formats:
ALLOWED_EXTENSIONS = ['mp4', 'avi', 'mov', 'mkv', 'wmv', 'flv']
If you encounter any issues during installation or usage:
CodeAj offers complete project setup, source code explanation, and custom modifications as addon services.
Our team is here to assist you with installation and setup.