metadata
title: Business Card Extractor
emoji: ๐จ
colorFrom: red
colorTo: yellow
sdk: gradio
sdk_version: 5.37.0
app_file: app.py
pinned: false
Business Card Data Extractor ๐ผ
An AI-powered tool that extracts structured data from business card images using advanced AI models. Upload business card images and get organized data exported to Excel files with automatic Google Drive storage.
Features
- Batch Processing: Process multiple business cards at once (up to 5 per batch)
- AI Model Selection: Choose between Speed-Optimized AI (fast) or Accuracy-Optimized AI (high accuracy)
- Google Drive Storage: Automatic upload to organized Drive folders
- Excel Export: Get data in two formats:
- Current session results
- Cumulative database (appends across sessions)
- Smart Data Extraction: Extracts name, company, title, emails, phones, address, website
- Direct Links: Access files directly through Google Drive URLs
How to Use
- Setup: Complete the setup process below (one-time)
- Upload Images: Select up to 5 business card images
- Choose Model: Select AI model (Speed-Optimized for fast processing, Accuracy-Optimized for best results)
- Process: Click "Extract Business Card Data"
- Access Files: Download temporary copies or access permanent files via Google Drive links
Supported Data Fields
- Name: Full name from business card
- Company: Company/organization name
- Title: Job title/position
- Emails: Email addresses (comma-separated if multiple)
- Phones: Phone numbers (comma-separated if multiple)
- Address: Full address information
- Website: Company website URL
- Processing Info: Timestamp, model used, filename
Setup Instructions
1. AI API Key
- Get your API key from: https://aistudio.google.com/
- Set as environment variable:
Gemini_API
2. Google Drive API Setup
Create Google Cloud Project:
- Go to https://console.cloud.google.com/
- Create a new project or select an existing one
Enable Google Drive API:
- In the Google Cloud Console, go to "APIs & Services" > "Library"
- Search for "Google Drive API" and enable it
Create OAuth 2.0 Credentials:
- Go to "APIs & Services" > "Credentials"
- Click "+ CREATE CREDENTIALS" > "OAuth client ID"
- Select "Desktop application"
- Download the JSON file
- Extract
client_id
andclient_secret
from the JSON
Set Environment Variables:
GOOGLE_CLIENT_ID=your_client_id_here GOOGLE_CLIENT_SECRET=your_client_secret_here
3. Local Development Setup
Install Dependencies:
pip install -r requirements.txt
Run Locally First:
python app.py
- Complete the OAuth flow in your browser
- This creates
token.pickle
file
4. Deployment Setup (Hugging Face Spaces, etc.)
Generate Token for Deployment:
python convert_token_to_base64.py
- This converts
token.pickle
to a base64 string
- This converts
Set Environment Variables in your deployment platform:
Gemini_API=your_ai_api_key GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_TOKEN_BASE64=your_base64_encoded_token
Google Drive Folders
- ๐ Exports: https://drive.google.com/drive/folders/1k5iP4egzLrGJwnHkMhxt9bAkaCiieojO
- ๐ผ๏ธ Images: https://drive.google.com/drive/folders/1gd280IqcAzpAFTPeYsZjoBUOU9S7Zx3c
Technical Details
- Image Formats: JPG, JPEG, PNG, WEBP, BMP
- Maximum File Size: 10MB per image
- Batch Processing: Up to 5 cards per API call
- Storage: Automatic upload to Google Drive
- Models: Speed-Optimized AI (fast processing) / Accuracy-Optimized AI (best accuracy)