AI Graduation Booth is an interactive Society Day activity built for Iqra University by IU-AICIS
(Iqra University Artificial Intelligence, Advanced Computing, and Information Security Society).
This project lets students stand in front of a camera, capture their photo with a countdown, and receive an AI-generated portrait of themselves in an Iqra University graduation gown and cap.
Prepared and led by the society AI team.
This booth was designed for Society Day at Iqra University as an engaging, future-focused student experience:
- Students visit the booth
- A live camera captures their photo (
3-2-1countdown) - AI transforms the image into a graduation-style portrait
- The image can be delivered by email directly from the booth app
- Runs a FastAPI backend for image generation workflow
- Uses OpenAI GPT Image model (
gpt-image-1.5) for image edits/generation - Uses local reference images to guide output style
- Saves uploads and generated outputs locally
- Generates QR image (optional/local-network use)
- Sends generated image via Gmail SMTP
- Provides a camera-first web interface with fallback file upload
- Camera capture with live preview
3-2-1countdown before photo capture- Automatic submit of captured image to backend
- AI-generated graduation portrait output
- Email delivery button + optional auto-send when email is entered
- Robust JSON error handling for upload/API/config/file/email issues
- Local static hosting of generated files
- Python
- FastAPI
- OpenAI Images API (GPT Image)
requestsqrcode- Gmail SMTP (
smtplib) - Simple HTML/CSS/JS frontend
GraduateGo/
├── backend/
│ ├── main.py
│ ├── services/
│ │ ├── openai_image.py
│ │ ├── storage.py
│ │ ├── qr.py
│ │ └── email_delivery.py
│ ├── static/
│ │ ├── index.html
│ │ ├── inputs/
│ │ └── outputs/
│ └── utils/
│ ├── prompt.py
│ └── env_loader.py
├── .env.example
├── requirements.txt
└── README.md
- Python 3.11+ (project currently tested with local venv setup)
- OpenAI API key with image generation access
- Gmail account with 2FA and App Password (for email sending)
git clone <your-repo-url>
cd GraduateGo
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtcp .env.example .envFill required values in .env.
OPENAI_API_KEY(required)OPENAI_IMAGE_MODEL(default:gpt-image-1.5)OPENAI_REFERENCE_IMAGES(optional, comma-separated paths)OPENAI_IMAGE_SIZE(optional)OPENAI_IMAGE_QUALITY(optional)OPENAI_IMAGE_FORMAT(optional)
LOCAL_IP(optional but recommended for LAN QR usage)
SMTP_HOST=smtp.gmail.comSMTP_PORT=587SMTP_USER=<your-gmail>SMTP_PASS=<gmail-app-password>FROM_EMAIL=<your-gmail>SMTP_USE_TLS=true
Place reference images in:
backend/static/inputs/
Examples:
backend/static/inputs/reference1.jpgbackend/static/inputs/reference2.jpegbackend/static/inputs/reference3.jpg
You may also explicitly set:
OPENAI_REFERENCE_IMAGES=static/inputs/reference1.jpg,static/inputs/reference2.jpgcd backend
source ../.venv/bin/activate
uvicorn main:app --host 0.0.0.0 --port 8000Open in browser:
- Local machine:
http://localhost:8000
- Open the web app on booth laptop
- Click Start Camera
- Student stands in front of camera
- Click Click Photo
- Countdown runs (
3-2-1) - Portrait is generated
- Enter student email and send image
Fallback:
- If camera permission fails, use file upload input on the page
- Input:
multipart/form-datawith fieldfile - Output:
{
"image_url": "/static/outputs/<file>.jpg",
"qr_url": "/static/outputs/qr_<file>.png"
}- Input:
{
"email": "student@example.com",
"image_url": "/static/outputs/<file>.jpg"
}- Output:
{
"message": "Image sent successfully."
}For Gmail SMTP to work:
- Enable Google account 2-Step Verification
- Generate a Gmail App Password
- Use App Password in
SMTP_PASS
Do not use your normal Gmail account password in SMTP_PASS.
- Check
.envlocation:GraduateGo/.envorGraduateGo/backend/.env
- Ensure exact format:
OPENAI_API_KEY=sk-...- Restart server after changes
- API key is present but incorrect/expired
- Your OpenAI project has hit rate/usage limits
- Wait and retry, or use a key/project with available quota
- Confirm
SMTP_USER,SMTP_PASS,FROM_EMAIL - Ensure Gmail App Password is used
- Check internet access and firewall rules
- Allow camera permission in browser settings
- Use fallback file upload if camera is blocked
- Captured and generated images are stored locally in:
backend/static/inputs/backend/static/outputs/
- For public events, define a retention policy (e.g., delete old files after event/day)
- Avoid collecting unnecessary personal information
Built for Iqra University Society Day under IU-AICIS
Project lead context: AI team leadership from the society side.
If you are deploying this booth with new volunteers, share this README with them before event day for quick onboarding.