Skip to content

BoardCamAI - Mobile app that analyzes PCB images with YOLOv8 through a FastAPI backend and displays defects with bounding boxes. Includes camera capture, upload, + history.

Notifications You must be signed in to change notification settings

bforce541/BoardCamAI

Repository files navigation

BoardCamAI

Real-time PCB defect detection using YOLOv8, FastAPI, and React Native.

BoardCamAI is a mobile application designed to capture PCB images, analyze them using a YOLOv8 object detection model, and display component and defect information with bounding box overlays. The app supports camera capture, image uploads, historical scan storage, and seamless navigation throughout the interface.

Features

Mobile App (React Native)

  • Capture PCB images using the device camera
  • Upload PCB images from the gallery
  • Real-time analysis using a FastAPI backend
  • Bounding box overlays with labels and confidence
  • Automatic scan history storage via AsyncStorage
  • View and inspect past scans
  • Consistent UI with smooth navigation

Backend (FastAPI + YOLOv8)

  • Accepts base64-encoded images via POST /analyze
  • Decodes and preprocesses images
  • Runs YOLOv8 inference for detection
  • Returns bounding boxes, labels, and confidence scores
  • Auto-loads YOLOv8n or a custom model
  • Includes a full fallback mode using mock predictions
  • Configured CORS support for Expo clients

Tech Stack

Frontend

  • React Native (Expo)
  • TypeScript
  • React Navigation
  • react-native-svg
  • AsyncStorage

Backend

  • FastAPI
  • Python
  • YOLOv8 (Ultralytics)
  • Pillow
  • NumPy
  • SQLite (optional)

App Flow

  1. User launches the app and lands on the Home screen with recent scans and quick actions.
  2. The user captures a PCB image or uploads one from their gallery; the image is converted to base64.
  3. The base64 image is sent to the FastAPI backend at the /analyze endpoint.
  4. The backend decodes the image, runs YOLOv8 detection (with a fallback to mock mode if needed), and returns bounding boxes, labels, and confidence scores.
  5. The ResultScreen displays the image with scaled bounding boxes and a summary of detections.
  6. The scan is saved locally using AsyncStorage.
  7. The History screen allows the user to review all saved scans and open them for detailed viewing.

The YOLOv8 model (yolov8n.pt) is automatically downloaded if not present.

Usage

  1. Capture or upload a PCB image.
  2. Verify detections appear on the Result screen.
  3. Confirm the scan is saved to history.
  4. Open the History screen and load saved scans.

The complete end-to-end pipeline has been verified to function correctly.

About

BoardCamAI - Mobile app that analyzes PCB images with YOLOv8 through a FastAPI backend and displays defects with bounding boxes. Includes camera capture, upload, + history.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published