Skip to content

πŸŽ“ Learn JavaScript by building a webcam filter app! 8 progressive levels covering React, Canvas, AI, and Machine Learning. Perfect for bootcamps, classrooms, and self-study.

License

Notifications You must be signed in to change notification settings

devgunnu/LearnLens

Repository files navigation

LearnLens - AI-Powered Webcam Filters 🎨

Transform Your Webcam Experience with Artificial Intelligence 20+ real-time filters β€’ AI recommendations β€’ Face detection β€’ Emotion recognition β€’ 100% private & browser-based

License React AI Powered Build Live Demo


✨ Why LearnLens?

LearnLens is a cutting-edge webcam filter application powered by AI and machine learning. Apply stunning real-time filters, get personalized recommendations, and explore advanced face detection - all in your browser with zero installation required.

🎯 Key Features

  • 🎨 20+ Stunning Filters - Vintage, Cyberpunk, Neon, Moonlight, and more
  • πŸ€– AI Recommendations - Powered by Google Gemini API for personalized suggestions
  • πŸ‘οΈ AI Vision Analysis - Get smart filter suggestions based on your appearance
  • 🧠 Face Detection - 68-point facial landmarks using TensorFlow.js
  • 😊 Emotion Recognition - Detect 7 different emotions in real-time
  • πŸ¦„ Draggable Stickers - 20+ fun emoji stickers to add personality
  • πŸ“Έ Photo Capture - Download your filtered photos instantly
  • πŸ”’ 100% Private - All processing happens locally in your browser
  • ⚑ Real-Time Processing - Smooth 60fps performance
  • πŸ“± Cross-Platform - Works on desktop and mobile browsers

πŸš€ Try It Now

No installation, no sign-up, no tracking. Just open and use!


πŸŽ“ Want to Learn How It's Built?

LearnLens doubles as an interactive learning platform! Follow our comprehensive 8-level tutorial to build the entire application from scratch.

πŸ“š Complete Learning Journey:

Level Topic Technologies Time
1️⃣ React Basics React, JSX, Hooks 1-2 hours
2️⃣ Webcam & Canvas WebRTC, Canvas API 2-3 hours
3️⃣ Filters & Effects CSS Filters 1-2 hours
4️⃣ Photo Capture Canvas API, Blob 1-2 hours
5️⃣ Stickers & Drag Drag & Drop API 2-3 hours
6️⃣ AI Integration Gemini API 2-3 hours
7️⃣ AI Vision Multimodal AI 2-3 hours
8️⃣ Face Detection TensorFlow.js 3-4 hours

Total Learning Time: ~15-20 hours

πŸ‘‰ View Full Learning Path


πŸ› οΈ Quick Start

For Users (Run the App):

# Clone the repository
git clone https://github.com/devgunnu/LearnLens.git
cd LearnLens

# Install dependencies
npm install

# Start the app
npm start

# Open http://localhost:3000

For AI Features (Optional):

# Get a free API key from https://aistudio.google.com/app/apikey
# Add it in the app's settings panel

πŸ€– AI Features

1. AI Filter Recommendations

Get personalized filter suggestions based on the time of day, mood, and context.

"Feeling productive?" β†’ Suggests Focus, Clarity filters
"Evening vibes?" β†’ Suggests Warm, Vintage filters

2. AI Vision Analysis

Upload your photo and get personalized suggestions:

  • Skin tone analysis
  • Lighting recommendations
  • Best filter matches for your appearance

3. Face Detection

Real-time face analysis powered by TensorFlow.js:

  • 68 facial landmark points
  • Face contours (jawline, eyebrows, nose, lips, eyes)
  • Face matching and similarity detection

4. Emotion Recognition

Detect 7 emotions in real-time:

  • Happy, Sad, Angry, Surprised, Fearful, Disgusted, Neutral

🎨 Available Filters

Artistic Effects:

  • Vintage - Classic film look
  • Cyberpunk - Futuristic neon vibes
  • Neon - Electric glow effect
  • Moonlight - Ethereal blue tones

Color Adjustments:

  • Warm - Cozy, inviting tones
  • Cool - Fresh, professional look
  • Vibrant - Saturated, punchy colors
  • Muted - Subtle, sophisticated tones

Creative Styles:

  • Dramatic - High contrast
  • Ethereal - Dreamy, soft focus
  • Noir - Black and white with grain
  • Retro - 80s/90s aesthetics

...and 10+ more!


πŸ›‘οΈ Privacy & Security

  • βœ… No server uploads - All processing happens locally
  • βœ… No data collection - Your photos never leave your device
  • βœ… No tracking - No analytics, no cookies
  • βœ… Open source - Audit the code yourself
  • βœ… API key control - You manage your own AI keys

πŸ’» Tech Stack

Core Technologies:

  • React 19.2 - Modern UI framework
  • WebRTC - Real-time media streaming
  • Canvas API - 2D graphics rendering
  • Tailwind CSS - Utility-first styling
  • Framer Motion - Smooth animations

AI & Machine Learning:

  • Google Gemini API - Text and vision AI
  • TensorFlow.js - Browser-based ML
  • Face-API.js - Face detection library

Build Tools:

  • Create React App - Build tooling
  • GitHub Pages - Deployment
  • Git Branches - Level-based workflow
  • Environment Variables - Secure config

πŸ“‚ Project Structure

LearnLens/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ models/              # Pre-trained ML models for face detection
β”‚   β”‚   β”œβ”€β”€ tiny_face_detector_model/
β”‚   β”‚   β”œβ”€β”€ face_landmark_68_model/
β”‚   β”‚   β”œβ”€β”€ face_expression_model/
β”‚   β”‚   └── face_recognition_model/
β”‚   β”œβ”€β”€ index.html
β”‚   └── manifest.json
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.js              # Main component (1800+ lines of learning material)
β”‚   β”œβ”€β”€ App.css             # Complete styling (1500+ lines)
β”‚   β”œβ”€β”€ index.js            # React entry point
β”‚   └── index.css           # Global styles
β”‚
β”œβ”€β”€ docs/                   # Learning documentation
β”‚   β”œβ”€β”€ README-LEVEL-1.md   # Level 1: React Basics
β”‚   β”œβ”€β”€ README-LEVEL-2.md   # Level 2: Webcam & Canvas
β”‚   β”œβ”€β”€ README-LEVEL-3.md   # Level 3: Filters & Effects
β”‚   β”œβ”€β”€ README-LEVEL-4.md   # Level 4: Photo Capture
β”‚   β”œβ”€β”€ README-LEVEL-5.md   # Level 5: Stickers & Drag
β”‚   β”œβ”€β”€ README-LEVEL-6.md   # Level 6: AI Integration
β”‚   β”œβ”€β”€ README-LEVEL-7.md   # Level 7: AI Vision
β”‚   └── README-LEVEL-8.md   # Level 8: Face Detection
β”‚
β”œβ”€β”€ .env.example            # Environment variable template
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md               # This file
β”œβ”€β”€ CONTRIBUTING.md         # Contributor guidelines
└── CODE_EXAMPLES.md        # Additional code examples

Git Branches:
β”œβ”€β”€ main                    # Complete production code
β”œβ”€β”€ level-1-basics          # Starting point for Level 1
β”œβ”€β”€ level-2-webcam          # Starting point for Level 2
β”œβ”€β”€ ... (all 8 levels)
β”œβ”€β”€ level-1-solution        # Reference solution for Level 1
└── ... (all 8 solutions)

🌐 Browser Support

Browser Version Support
Chrome 90+ βœ… Full Support
Firefox 88+ βœ… Full Support
Safari 14+ βœ… Full Support
Edge 90+ βœ… Full Support
Opera 76+ βœ… Full Support

Requirements:

  • Webcam access
  • WebRTC support
  • Modern JavaScript (ES6+)

πŸ“š Learning Path for Developers

Want to build LearnLens yourself? Follow our progressive tutorial:

🟒 Beginner Levels (1-2)

Level 1: React Basics

  • Component structure and JSX
  • useState for state management
  • Event handlers and user input

Level 2: Webcam & Canvas

  • useRef hook for DOM access
  • WebRTC getUserMedia API
  • Canvas 2D rendering
  • requestAnimationFrame loop

🟑 Intermediate Levels (3-5)

Level 3: Filters & Effects

  • CSS filter property
  • Canvas transformations
  • Dynamic filter switching

Level 4: Photo Capture

  • Canvas toDataURL()
  • Blob API and downloads
  • Modal components

Level 5: Stickers & Drag

  • Drag and Drop API
  • Coordinate transformations
  • Event handling

πŸ”΄ Advanced Levels (6-8)

Level 6: AI Integration

  • Environment variables
  • API key security
  • Async/await patterns
  • Gemini AI API

Level 7: AI Vision

  • Base64 encoding
  • Multimodal AI (text + image)
  • Vision API prompting

Level 8: Face Detection

  • TensorFlow.js basics
  • Loading ML models
  • Facial landmarks
  • Expression recognition

πŸ“– Learning Instructions:

# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/LearnLens.git
cd LearnLens

# Install dependencies
npm install

# Start with Level 1
git checkout level-1-basics

# Read the tutorial
cat docs/README-LEVEL-1.md

# Start building!
npm start

# When complete, merge and move to next level
git checkout main
git merge level-1-basics
git checkout level-2-webcam

Each level includes:

  • βœ… Step-by-step guide
  • βœ… Code examples with comments
  • βœ… Key concepts explained
  • βœ… Knowledge checks
  • βœ… Solution branch for reference

πŸ“‚ Project Structure

learnlens/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ models/              # Pre-trained ML models
β”‚   β”‚   β”œβ”€β”€ tiny_face_detector_model/
β”‚   β”‚   β”œβ”€β”€ face_landmark_68_model/
β”‚   β”‚   β”œβ”€β”€ face_expression_model/
β”‚   β”‚   └── face_recognition_model/
β”‚   β”œβ”€β”€ index.html
β”‚   └── manifest.json
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ landing/         # Landing page components
β”‚   β”‚   └── app/             # App components
β”‚   β”œβ”€β”€ App.js               # Main component
β”‚   β”œβ”€β”€ App.css              # Styling
β”‚   └── index.js             # Entry point
β”‚
β”œβ”€β”€ docs/                    # Learning tutorials (8 levels)
β”œβ”€β”€ tailwind.config.js       # Tailwind configuration
β”œβ”€β”€ package.json
└── README.md

🀝 Contributing

We welcome contributions! Whether you want to:

  • πŸ› Report bugs
  • ✨ Suggest features
  • πŸ“š Improve documentation
  • 🎨 Add new filters
  • πŸ€– Enhance AI features
  • 🌍 Translate to other languages

πŸ“– Contribution Guidelines β†’


πŸ“œ License

MIT License - Free to use, modify, and distribute.

What this means:

  • βœ… Use for personal projects
  • βœ… Use in your portfolio
  • βœ… Use commercially
  • βœ… Modify and extend
  • πŸ“ Keep the license notice

Community:


πŸ™ Acknowledgments

Built with amazing open-source tools:

  • React Team - UI framework
  • TensorFlow.js - ML in the browser
  • Vladimir Mandic - face-api.js
  • Google - Gemini API
  • Aceternity UI - Beautiful components
  • All Contributors - Making this better

❓ FAQ

Is LearnLens free?

Yes! Completely free and open-source. AI features require a free Gemini API key.

Is my data private?

Absolutely. All processing happens locally in your browser. Nothing is uploaded to servers.

Do I need to install anything?

No! Just open the website and start using it. For development, you'll need Node.js.

Can I use this offline?

Core filters work offline. AI features require internet for API calls.

What if I don't have a webcam?

You can still upload photos and apply filters!

Can I add custom filters?

Yes! The code is open-source. Add your own CSS filters or contribute them back.

How does face detection work?

We use TensorFlow.js and face-api.js to run ML models directly in your browser.

Can I use this for commercial projects?

Yes, under the MIT license. Just keep the license notice.


🌟 Show Your Support

If you love LearnLens:

  • ⭐ Star this repo
  • 🍴 Fork it
  • πŸ“’ Share with friends
  • πŸ› Report issues
  • 🀝 Contribute

πŸ“ž Contact & Support


Ready to transform your webcam experience?

πŸš€ Launch App | πŸ“š Learn to Build | 🀝 Contribute

Made with ❀️ for creators, learners, and developers

About

πŸŽ“ Learn JavaScript by building a webcam filter app! 8 progressive levels covering React, Canvas, AI, and Machine Learning. Perfect for bootcamps, classrooms, and self-study.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •