A sophisticated computer vision application for real-time iris-pupil ratio analysis using advanced machine learning algorithms. This professional tool provides precise measurements, generates comprehensive PDF reports, and offers a modern web interface for research and educational applications.
- Advanced Computer Vision: Utilizes MediaPipe Face Mesh for precise facial landmark detection
- Real-time Analysis: Live camera capture with instant processing capabilities
- Professional UI/UX: Modern, responsive interface with gradient styling and smooth animations
- Comprehensive Reporting: Generates detailed PDF reports with proper image formatting
- Dual Eye Analysis: Independent analysis of both left and right eyes
- Research-Grade Accuracy: Implements contour analysis and ellipse fitting for precise measurements
- Computer Vision Pipeline: Advanced image processing with OpenCV and MediaPipe
- Machine Learning Integration: Facial landmark detection with 468-point mesh
- Real-time Processing: Live video stream analysis with instant feedback
- Professional Reporting: PDF generation with proper aspect ratios and formatting
- Responsive Design: Cross-platform compatibility with modern web standards
- Error Handling: Robust validation and user-friendly error messages
- Data Management: Secure patient information handling and session management
- Precision Measurement: Iris and pupil radius calculation in millimeters
- Advanced Detection: Contour analysis with ellipse fitting for pupil boundaries
- Ratio Analysis: Iris-to-pupil ratio calculation with clinical reference ranges
- Visual Annotations: Real-time overlay of detected boundaries on images
- Clinical Standards: Normal range indicators (2.5-4.0) for research context
- Python 3.8 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/yourusername/iris-pupil-analyzer.git cd iris-pupil-analyzer
-
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Access the application Open your browser and navigate to
http://localhost:8501
- Fork this repository to your GitHub account
- Connect to Streamlit Cloud:
- Go to share.streamlit.io
- Sign in with your GitHub account
- Click "New app"
- Select your forked repository
- Set the main file path to
app.py
- Click "Deploy"
-
Upload files to GitHub:
- Ensure all files are in your repository
- Include
requirements.txt
,setup.sh
, and.streamlit/config.toml
-
Configure Streamlit Cloud:
- Set the main file path to
app.py
- The
setup.sh
script will automatically configure the server
- Set the main file path to
iris-pupil-analyzer/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── setup.sh # Streamlit Cloud deployment script
├── .streamlit/
│ └── config.toml # Streamlit configuration
└── .gitignore # Git ignore file
- Fill in the patient's name, age, gender, and medical conditions in the sidebar
- Click "Save Patient Info" to store the information
- Upload Image: Choose a clear frontal face image (JPG, JPEG, or PNG format)
- Live Camera Capture: Use your webcam for real-time video capture
- Click "Start Live Camera" to activate the webcam
- You'll see a LIVE VIDEO STREAM with a capture button
- Position your face clearly in the camera view
- Click the "Take photo" button in the camera widget to capture
- Use "Reset Camera" to start over if needed
- Ensure the image has good lighting and visible eyes
- The image should be high resolution for better accuracy
- Click "Analyze Image" to process the uploaded image
- Wait for the analysis to complete (usually takes 5-10 seconds)
- Review the results displayed in the right column
- Click "Generate PDF Report" to create a comprehensive report
- Download the PDF file containing all analysis results and patient information
- Facial Landmark Detection: MediaPipe Face Mesh with 468-point mesh
- Iris Localization: Precise positioning using predefined iris landmarks
- Pupil Detection: Advanced contour analysis with ellipse fitting algorithms
- Measurement Conversion: Pixel-to-millimeter conversion using IPD reference
- Ratio Calculation: Validated iris-to-pupil ratio computation
- MediaPipe Face Mesh: 468 facial landmarks for millimeter-precision detection
- Contour Analysis: Ellipse fitting with geometric validation for pupil boundaries
- Adaptive Thresholding: Dynamic image processing for varying lighting conditions
- Geometric Validation: Physiological range validation for measurement accuracy
- Normal Iris-to-Pupil Ratio: 2.5 - 4.0 (clinical reference range)
- Average Adult IPD: 63mm (interpupillary distance for pixel-to-mm conversion)
- Pupil Size Range: 20-70% of iris diameter (physiological validation)
- Processing Speed: Real-time analysis with <2 second response time
- Research Use Only: This tool is designed for research and educational purposes
- Not Medical Advice: Results should not be used for medical diagnosis
- Professional Consultation: Always consult qualified healthcare professionals
- Image Quality: Results depend on image quality and lighting conditions
Aug 2024 - Feb 2025
Machine Learning Intern
- Developed a real-time IRIS-PUPIL detection pipeline using CNNs, achieving 93% accuracy
- Engineered a modular architecture with OpenCV and Python, designed for future API-based deployment
- IRIS-PUPIL Ratio Detection:
- Created a CNN-based system for real-time pupil measurement using webcam input
- Designed with modular code and testability, working on simulating REST API integration for scalability in medical applications
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add feature'
- Push to the branch:
git push origin feature-name
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- MediaPipe: For facial landmark detection capabilities
- OpenCV: For computer vision processing
- Streamlit: For the web application framework
- ReportLab: For PDF generation functionality
For support, questions, or feature requests:
- Open an issue on GitHub
- Contact the development team
- Check the documentation for common solutions
Version: 1.0.0
Last Updated: December 2024
Maintainer: Your Name