Skip to content

Ashu-213/PhotoBooth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Indian Passport Photo Generator

A minimalist, single-page web utility that accepts any human portrait photo and instantly generates a print-ready A4 sheet of standard Indian passport photos.

Features

  • Face Detection & Alignment: Automatically aligns crooked photos using eye detection.
  • AI Background Removal: Clears out any existing background.
  • Auto-Formatting: Replaces background with pure white and intelligently crops to exact passport proportions (35×45mm).
  • Print-Ready Layout: Generates an A4 PDF sheet with 8 perfectly spaced photos.
  • Client-Side Privacy: Processes entirely locally (no images stored).

Tech Stack

  • Frontend: React, Vite, Tailwind CSS
  • Backend: Python 3, Flask, OpenCV (CV2), rembg (Background removal), ReportLab (PDF)

Local Setup

1. Backend (Python)

Navigate to the backend folder, set up a virtual environment, and install requirements:

cd backend
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate

pip install -r requirements.txt
python app.py

Backend runs on http://localhost:5000

2. Frontend (React)

Open a new terminal, navigate to the frontend folder, install packages, and start Vite:

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:5173

Usage

  1. Open the frontend in your browser.
  2. Drag and drop any JPG or PNG containing a human face.
  3. Wait a few seconds for processing (the very first run may take slightly longer to load the AI model into memory).
  4. Download your passport photo as a PNG or your ready-to-print A4 PDF sheet!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors