Skip to content

stspanho/spectacles-ad-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚫 AR Ad Blocker

Demo

🚫 Blocking ads in real-time with AI-powered augmented reality!

This is an augmented reality experience built for Snapchat Spectacles, where you can:

  • Detect advertisements in your real-world environment using AI
  • Block ads visually by overlaying them with AR content
  • Use pinch gestures to trigger ad detection and blocking
  • Experience real-time AI-powered advertisement identification

📋 Acknowledgments

This project is based on the Snapchat Spectacles Depth Cache Sample, which provides the foundational depth sensing and world space conversion capabilities.


📹 Demo Video

https://www.linkedin.com/feed/update/urn:li:activity:7341484830682923008/


🛠️ Built With

  • Lens Studio (Snapchat's AR development environment)
  • Google Gemini AI (for advertisement detection)
  • Depth Sensing (for accurate 3D placement)
  • Gesture Recognition (pinch to activate)
  • Remote Service Gateway (for AI API integration)

🧩 How to Use

  1. Load the Lens
    Import the project into Lens Studio and load it on your Snapchat Spectacles.

  2. Point at Advertisements
    Look at any advertisements in your environment (billboards, signs, digital displays, etc.).

  3. Pinch to Activate
    Use the pinch gesture to trigger the AI-powered ad detection system.

  4. Watch Ads Get Blocked
    The AI will identify advertisements and overlay them with blocking content in real-time.


🤖 AI Features

  • Real-time Detection: Uses Google Gemini AI to identify advertisements in camera feed
  • Bounding Box Analysis: Precisely locates ad boundaries for accurate blocking
  • Depth-Aware Placement: Uses depth sensing to place blocking content in 3D space
  • Smart Labeling: AI provides descriptive labels for each detected advertisement
  • Multiple Ad Support: Can detect and block up to 25 advertisements simultaneously

📦 Technical Components

Core Scripts

  • SceneController.ts: Main orchestration and gesture handling
  • GeminiAPI.ts: Integration with Google Gemini AI for ad detection
  • DepthCache.ts: Depth frame management and world space conversion
  • SpeechUI.ts: User interface for speech input (future feature)
  • ResponseUI.ts: Display of AI responses and blocking status

AI Integration

  • Google Gemini 2.5 Pro: Advanced AI model for advertisement detection
  • JSON Response Schema: Structured data format for bounding box coordinates
  • Image Processing: Real-time camera frame analysis and encoding

AR Features

  • 3D Plane Generation: Creates blocking overlays in world space
  • Depth-Aware Positioning: Uses depth data for accurate 3D placement
  • Gesture Recognition: Pinch-to-activate functionality
  • Visual Feedback: Loading states and response bubbles

⚠️ Notes

This is a proof of concept (PoC) that demonstrates the potential of AI-powered AR ad blocking. Key considerations:

  • Privacy: Camera data is processed through Google's Gemini API
  • Accuracy: AI detection may have false positives/negatives
  • Performance: Real-time processing requires stable internet connection
  • Ethical Use: Intended for personal use and research purposes

🔧 Development Setup

  1. Install Lens Studio (version 5.10.1 or later)
  2. Import Project: Open Ad Blocker.esproj in Lens Studio
  3. Configure API: Set up Google Gemini API credentials
  4. Test on Device: Deploy to Snapchat Spectacles for testing

📱 Supported Devices

  • Snapchat Spectacles (2024)
  • Front and Back Camera support
  • Gesture Recognition via pinch detection
  • Depth Sensing for accurate 3D placement

🚀 Future Enhancements

  • Offline Detection: Local AI models for privacy
  • Custom Blocking: User-defined blocking patterns
  • Speech Commands: Voice-activated ad blocking
  • Analytics: Track blocked ads and effectiveness
  • Multi-language: Support for international advertisements

Enjoy blocking ads in the real world! 🚫✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published