Skip to content

thierryskoda/window

Repository files navigation

Window Detector - AR LiDAR Measurement MVP

An iOS-first augmented reality app that detects windows and measures their real-world dimensions using LiDAR depth sensing and on-device machine learning.

For AI agents: This project is iOS-only. No web or Android support. Do not add web config, react-native-web, react-dom, or platform guards for web. Use expo run:ios --dev-client for development.

Quick Start

Prerequisites

  • iPhone 12 Pro / 13 Pro / 14 Pro / 15 Pro or iPad Pro (LiDAR required)
  • Xcode 15+
  • macOS
  • Node.js LTS
  • pnpm or npm

Installation

# Install dependencies
pnpm install

# Build custom dev client
npx expo run:ios --dev-client

# Start dev server
npx expo start --dev-client

Scan the QR code on your device to connect to the dev server.

Architecture

Tabs

  • Window (ExecuTorch) – Single tab: react-native-executorch, window.pte model, live camera frames. TFLite adapter (window-detector.ts + detector-adapter.ts) exists in codebase for optional/alternate use.

Data Flow

Camera Frame → Detector (ExecuTorch or TFLite)
                ↓
           WindowBoundingBox2D (normalized coordinates)
                ↓
           Overlay + confidence display

Module Structure

src/features/measurement/
├── tabs/
│   ├── detection-custom-executorch-camera-tab-screen.tsx   # ExecuTorch pipeline (main tab)
│   └── debug-panel.tsx
├── window-detector.ts           # TFLite model (adapter path)
├── executorch-window-detector.ts
├── detector-adapter.ts          # Seam for ExecuTorch vs TFLite
├── native-arkit-provider.ts     # LiDAR raycast via window-detector-arkit
├── ar-session.ts
├── geometry.ts
├── types.ts
├── runtime-store.ts / runtime-stage.ts / runtime-bus.ts / runtime-context.tsx
├── blocking-screen.tsx
├── refine-overlay.tsx
└── pricing.ts

Native module: modules/window-detector-arkit (ARKit LiDAR raycast, used by native-arkit-provider).

Features

Current (MVP)

  • ✅ ExecuTorch detection tab (window.pte, live camera)
  • ✅ TFLite adapter in codebase (window-detector.ts + detector-adapter)
  • ✅ Real-time window detection, bounding box overlay with confidence
  • ✅ Native ARKit module for LiDAR raycast (window-detector-arkit)
  • ✅ iOS-only (LiDAR-focused roadmap)

Roadmap

  • Android support (ARCore)
  • Multi-object detection (doors, frames, etc.)
  • API integration for dynamic pricing
  • Measurement history + export
  • Telemetry and accuracy logging
  • Batch measurement mode

Usage

  1. Launch app → Redirects to Window tab (ExecuTorch camera).
  2. Point at window → Bounding box overlay and confidence.
  3. Debug panel → Expand for FPS, latency, frame count.

Configuration

Detection Models

  • ExecuTorch: Uses window.pte (see executorch-window-detector.ts and tab screen).
  • TFLite: Adapter in window-detector.ts; model URL/config there if enabling TFLite path.

Troubleshooting

"No camera device found"

  • Grant camera permissions
  • Use a physical iOS device (not simulator)

"Window Not Detected"

  • Angle camera more directly at window (not extreme angles)
  • Ensure window fully visible in frame
  • Better lighting may help detection confidence

Build Failures

# Clean and rebuild
rm -rf ios/Pods ~/Library/Developer/Xcode/DerivedData
pnpm install
npx expo run:ios --dev-client

Development

Running Tests

pnpm run lint      # ESLint (expo lint)
pnpm run typecheck # TypeScript (tsc --noEmit)

ML training (optional): pnpm run ml:prep, pnpm run ml:train, pnpm run ml:export, etc. See package.json scripts.

Debug Logs

Use the Debug panel in the Window tab for FPS, latency, and frame count.

Performance Profiling

Use Xcode Instruments to profile GPU/CPU usage during measurement flow.

Deployment

See docs/measurement-mvp-setup.md for dev client build and testing instructions.

For production builds:

npx eas build --platform ios --profile production

Stack

  • Framework: Expo Router, React Native
  • ML: react-native-executorch (main), react-native-fast-tflite (adapter in codebase)
  • Camera: react-native-vision-camera
  • Native AR: window-detector-arkit (local module, ARKit LiDAR)
  • Overlay: react-native-svg

License

Proprietary. All rights reserved.

Contact

For questions or collaboration, reach out to the development team.


MVP Status: Ready for iOS LiDAR device testing Last Updated: Feb 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors