An intelligent photo processing application that automatically detects and sorts event photos by bib numbers using Google Cloud Vision API and OpenCV.
- Automatic Bib Number Detection: Uses Google Cloud Vision API as primary method with Tesseract OCR fallback
- Bulk Photo Upload: Drag & drop interface for uploading multiple event photos
- Real-time Processing: Live progress tracking with async background processing
- Smart Sorting: Groups photos by detected bib numbers with confidence scoring
- Organized Export: Download sorted photos as ZIP files with organized folder structure
- Modern UI: Clean, responsive React interface with Tailwind CSS
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: Python + FastAPI + OpenCV + Google Cloud Vision
- Development: NPM orchestration for both frontend and backend
- Node.js 18+
- Python 3.8+
- Tesseract OCR
- Google Cloud Vision API (optional but recommended)
-
Clone the repository
git clone <repository-url> cd photo-processor
-
Install all dependencies
npm run install:all
-
Install Tesseract OCR
# macOS brew install tesseract # Ubuntu/Debian sudo apt-get install tesseract-ocr
-
Set up Google Cloud Vision (recommended)
- Follow instructions in
backend/setup_google_vision.md - Create service account and download JSON key
- Set environment variable or copy to backend directory
- Follow instructions in
# Start both frontend and backend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
npm run buildphoto-processor/
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── services/ # API client
│ │ └── types/ # TypeScript types
│ └── package.json
├── backend/ # Python FastAPI
│ ├── app/
│ │ ├── api/ # REST endpoints
│ │ ├── core/ # CV processing
│ │ ├── models/ # Data models
│ │ └── services/ # Business logic
│ ├── requirements.txt
│ └── main.py
├── package.json # NPM orchestration
└── README.md
POST /api/upload/photos- Upload event photosPOST /api/process/start- Start bib number detectionGET /api/process/status/{job_id}- Check processing progressGET /api/process/results/{job_id}- Get grouped resultsPOST /api/download/export- Create ZIP exportGET /api/download/file/{export_id}- Download ZIP file
Create backend/.env:
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
API_HOST=0.0.0.0
API_PORT=8000- Enable Cloud Vision API in Google Cloud Console
- Create service account with Vision API permissions
- Download JSON credentials
- Set
GOOGLE_APPLICATION_CREDENTIALSenvironment variable
See backend/setup_google_vision.md for detailed instructions.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details