- Get real-time info of user's eye movement using OpenCV.
- Gather the co-ordinates of the pupil according to the viewport.
- Plot a line graph for the co-ordinates.
- Pass the resulting graph through CNN for classifying.
- Displaying the test result.
- main.py :
- embedding the machine learning model to flask
- routing functions
- templates/ :
- frontend files
- static/ :
- media files
- model/ :
- pre-trained pickle file
- Flask
- OpenCV
- Tensorflow
- Matplotlib
- dlib
- NumPy
- PyTorch
- Torchvision
- Python 3.10 (recommended for compatibility with all packages)
- Visual Studio Build Tools (for installing dlib)
- A webcam
- Git (for cloning the repository)
-
Install Python 3.10
- Download Python 3.10 from Python's official website
- During installation, make sure to check "Add Python to PATH"
-
Install Visual Studio Build Tools
- Download Visual Studio Build Tools from Microsoft's website
- During installation, select "Desktop development with C++"
-
Clone the Repository
git clone https://github.com/Kiettranquoc/ADHD-identification.git cd ADHD-identification -
Create and Activate Virtual Environment
# Create virtual environment python -m venv .venv # Activate virtual environment # On Windows: .venv\Scripts\activate # On Linux/Mac: source .venv/bin/activate
-
Install Required Packages
pip install -r req.txt
-
Install dlib
# If you have Visual Studio Build Tools installed: pip install dlib # If the above fails, try the pre-built wheel: pip install https://github.com/jloh02/dlib/releases/download/v19.22/dlib-19.22.99-cp310-cp310-win_amd64.whl
-
Start the Flask Server
python main.py
You should see output similar to:
* Serving Flask app "main" (lazy loading) * Environment: production * Debug mode: on * Running on http://127.0.0.1:5000/ -
Access the Application
- Open your web browser
- Go to
http://localhost:5000 - You should see the main page of the application
-
Select Test Type
- Choose between ADHD or Autism test
- Each test has three difficulty levels: EASY, MEDIUM, and HARD
-
Starting a Test
- Click the "Start Test" button
- Allow camera access when prompted
- Position yourself in front of the camera
- Read the text displayed on screen
- The application will track your eye movements
-
Test Results
- After completing the test, results will be displayed
- The system analyzes eye movement patterns to make predictions
-
Camera Access Issues
- Make sure your webcam is properly connected
- Check browser permissions for camera access
- Try refreshing the page if camera doesn't initialize
-
Package Installation Issues
- If dlib installation fails, ensure Visual Studio Build Tools are properly installed
- Try using the pre-built wheel for dlib
- Make sure you're using Python 3.10
-
Application Not Starting
- Check if port 5000 is already in use
- Ensure all dependencies are properly installed
- Check the console for error messages
-
Eye Tracking Issues
- Ensure good lighting conditions
- Position yourself directly in front of the camera
- Remove glasses if they cause reflections
- Keep your head relatively still during the test
- The application requires a stable internet connection for initial setup
- Good lighting conditions are essential for accurate eye tracking
- The test results are for screening purposes only and should not be considered as medical diagnosis
- Keep the browser window active during the test
- Do not move too much during the test as it may affect eye tracking accuracy
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.