|
--- |
|
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 |
|
|
|
1. **Setup**: Complete the setup process below (one-time) |
|
2. **Upload Images**: Select up to 5 business card images |
|
3. **Choose Model**: Select AI model (Speed-Optimized for fast processing, Accuracy-Optimized for best results) |
|
4. **Process**: Click "Extract Business Card Data" |
|
5. **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 |
|
1. **Create Google Cloud Project**: |
|
- Go to https://console.cloud.google.com/ |
|
- Create a new project or select an existing one |
|
|
|
2. **Enable Google Drive API**: |
|
- In the Google Cloud Console, go to "APIs & Services" > "Library" |
|
- Search for "Google Drive API" and enable it |
|
|
|
3. **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` and `client_secret` from the JSON |
|
|
|
4. **Set Environment Variables**: |
|
```bash |
|
GOOGLE_CLIENT_ID=your_client_id_here |
|
GOOGLE_CLIENT_SECRET=your_client_secret_here |
|
``` |
|
|
|
### 3. Local Development Setup |
|
1. **Install Dependencies**: |
|
```bash |
|
pip install -r requirements.txt |
|
``` |
|
|
|
2. **Run Locally First**: |
|
```bash |
|
python app.py |
|
``` |
|
- Complete the OAuth flow in your browser |
|
- This creates `token.pickle` file |
|
|
|
### 4. Deployment Setup (Hugging Face Spaces, etc.) |
|
1. **Generate Token for Deployment**: |
|
```bash |
|
python convert_token_to_base64.py |
|
``` |
|
- This converts `token.pickle` to a base64 string |
|
|
|
2. **Set Environment Variables** in your deployment platform: |
|
```bash |
|
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) |
|
|