A modern full-stack application showcasing "privacy-by-fashion" concept. This app demonstrates how clothing can be designed to hide from YOLO computer vision detection, featuring both a Next.js frontend and Python-based YOLO detection backend.
-
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Open your browser: Navigate to http://localhost:3000
-
Start the YOLO server:
./start_py.sh
-
Or manually:
cd object-detection source venv/bin/activate python webrtc_server.py
-
Test detection:
cd object-detection source venv/bin/activate python test_inference_endpoint.py
- Next.js 15 with App Router
- TypeScript for type safety
- Tailwind CSS for styling
- shadcn/ui for components
- Lucide React for icons
- Stripe for payment processing
- Python 3.12+ with virtual environment
- YOLOv8 (Ultralytics) for object detection
- OpenCV for computer vision
- aiohttp for async web server
- PyTorch for ML framework
- Pillow for image processing
- Marketing-focused landing page
- Clear value proposition for privacy-by-fashion
- Call-to-action buttons for testing and shopping
- Privacy level explanations
- Responsive design
- Image Upload: Upload photos to test detection
- Camera Capture: Use webcam for real-time testing
- Real YOLO Detection: Live object detection using YOLOv8
- Results Display: Clear PASS/FAIL indicators with bounding boxes
- Confidence Scores: Shows detection confidence levels
- Annotated Images: Visual results with detection overlays
- Product Grid: Browse privacy-focused clothing
- Filtering: Filter by category, privacy level, search
- Product Details: Modal with size/color selection
- Shopping Cart: Local storage-based cart
- Mock Checkout: Simulated checkout process
- Clean authentication interface
- Demo credentials provided
- Privacy policy links
- Dark Theme: Sleek purple/slate gradient design
- Mobile-First: Fully responsive across all devices
- Accessibility: ARIA labels, keyboard navigation
- Performance: Optimized images, lazy loading
- Modern UI: Clean, professional interface
- Basic (60-70%): Subtle anti-detection patterns
- Enhanced (80-85%): Advanced pattern disruption
- Maximum (90-95%): Cutting-edge invisibility tech
POST /api/test-design- Test clothing design with AIPOST /api/generate-image- Generate realistic images using GeminiPOST /api/inference- Run YOLO detection on imagesGET /api/products- Product catalogPOST /api/cart- Cart managementPOST /api/checkout- Stripe checkout
POST /inference- YOLO object detection endpointWebSocket /ws- Real-time camera feedGET /health- Server health check
- Python 3.12+ installed
- Virtual environment support
The Python backend uses a virtual environment located in object-detection/venv/:
# Automatic setup (recommended)
./start_py.sh
# Manual setup
cd object-detection
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- ultralytics: YOLOv8 model
- opencv-python: Computer vision
- aiohttp: Async web server
- torch/torchvision: ML framework
- pillow: Image processing
- numpy: Numerical computing
# Start YOLO server (port 8080)
cd object-detection
source venv/bin/activate
python webrtc_server.py
# Test detection
python test_inference_endpoint.py
# Run camera demo
python webrtc_demo.pyโโโ src/ # Next.js frontend
โ โโโ app/ # App Router pages
โ โ โโโ page.tsx # Hero/Dashboard page
โ โ โโโ test/ # Privacy testing page
โ โ โโโ shop/ # Product catalog & cart
โ โ โโโ design/ # Design interface
โ โ โโโ checkout/ # Checkout flow
โ โ โโโ api/ # API routes
โ โโโ components/ # React components
โ โโโ contexts/ # React contexts
โ โโโ lib/ # Utilities
โ โโโ types/ # TypeScript definitions
โโโ object-detection/ # Python backend
โ โโโ venv/ # Virtual environment
โ โโโ webrtc_server.py # YOLO detection server
โ โโโ webrtc_demo.py # Camera demo
โ โโโ test_*.py # Test scripts
โ โโโ requirements.txt # Python dependencies
โ โโโ yolov8n.pt # YOLO model weights
โโโ public/ # Static assets
โโโ start_py.sh # Python setup script
โโโ package.json # Node.js dependencies
This app is ready for deployment on:
- Vercel (recommended for Next.js)
- Netlify
- Railway
- Any platform supporting Node.js
- Landing Page: Show the concept and value proposition
- Design Interface: Create custom privacy-focused clothing designs
- Test Privacy: Demonstrate real YOLO detection with live results
- Shop Collection: Browse products and add to cart
- Checkout: Complete the purchase flow with Stripe integration
Create a .env.local file in the root directory:
# Gemini API Configuration
GEMINI_API_KEY=your_gemini_api_key_here
# WebRTC Server Configuration
WEBRTC_SERVER_URL=http://localhost:8080
# Next.js Configuration
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Stripe Configuration
STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key- Start Python backend:
./start_py.sh - Start Next.js frontend:
npm run dev - Test integration: Visit
/testpage for live detection - Design clothing: Visit
/designpage for design interface
- Advanced AI Models: Integration with more sophisticated detection models
- User Authentication: Complete user management system
- Real-time Processing: Live video stream analysis
- Mobile App: React Native mobile application
- Product Reviews: User feedback and rating system
- Size Guide: AI-powered size recommendations
- Social Features: Share designs and privacy scores
- Cloud Deployment: Scalable cloud infrastructure
Python Backend Issues:
- Virtual environment not found: Run
./start_py.shto create it - Package installation fails: Ensure Python 3.12+ is installed
- Port 8080 in use: Change port in
webrtc_server.py
Frontend Issues:
- API calls fail: Ensure Python backend is running on port 8080
- Environment variables: Check
.env.localfile exists - Build errors: Run
npm installto update dependencies
Detection Issues:
- No detections: Check image quality and lighting
- Low confidence: Try different angles or lighting
- Server errors: Check Python backend logs
Built for TX2025 Hackathon ๐
Protecting your privacy through fashion