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.
- 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
- 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
- React Native (Expo)
- TypeScript
- React Navigation
- react-native-svg
- AsyncStorage
- FastAPI
- Python
- YOLOv8 (Ultralytics)
- Pillow
- NumPy
- SQLite (optional)
- User launches the app and lands on the Home screen with recent scans and quick actions.
- The user captures a PCB image or uploads one from their gallery; the image is converted to base64.
- The base64 image is sent to the FastAPI backend at the /analyze endpoint.
- The backend decodes the image, runs YOLOv8 detection (with a fallback to mock mode if needed), and returns bounding boxes, labels, and confidence scores.
- The ResultScreen displays the image with scaled bounding boxes and a summary of detections.
- The scan is saved locally using AsyncStorage.
- 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.
- Capture or upload a PCB image.
- Verify detections appear on the Result screen.
- Confirm the scan is saved to history.
- Open the History screen and load saved scans.
The complete end-to-end pipeline has been verified to function correctly.