rongo1
commited on
Commit
Β·
595f63f
1
Parent(s):
29d41e1
fix: FIXED README
Browse files
README.md
CHANGED
@@ -1,118 +1,53 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
- **Efficient Batch Processing**: Upload multiple cards, processed 5 at a time per API call
|
8 |
-
- **Model Selection**: Choose between Gemini 2.5 Flash (fast) or Pro (accurate)
|
9 |
-
- **Image Storage**: Optionally save business card images with timestamped filenames
|
10 |
-
- **AI-Powered Extraction**: Uses Gemini AI to extract:
|
11 |
-
- Names (full name, first name, last name)
|
12 |
-
- Job titles and departments
|
13 |
-
- Company information
|
14 |
-
- Email addresses (multiple supported)
|
15 |
-
- Phone numbers (multiple supported)
|
16 |
-
- Addresses
|
17 |
-
- Websites and social media links
|
18 |
-
- Additional information
|
19 |
-
- **Excel Export**: Automatically creates formatted Excel files
|
20 |
-
- **Data Consolidation**: Multiple emails/phones are combined with commas in a single cell
|
21 |
-
|
22 |
-
## Installation
|
23 |
-
|
24 |
-
1. Clone this repository
|
25 |
-
2. Install dependencies:
|
26 |
-
```bash
|
27 |
-
pip install -r requirements.txt
|
28 |
-
```
|
29 |
-
|
30 |
-
## Usage
|
31 |
-
|
32 |
-
1. Run the application:
|
33 |
-
```bash
|
34 |
-
python app.py
|
35 |
-
```
|
36 |
-
|
37 |
-
2. Open your browser to the provided URL (typically http://localhost:7860)
|
38 |
-
|
39 |
-
3. Upload one or more business card images
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
5. Download the generated Excel file
|
44 |
-
|
45 |
-
## Output Format
|
46 |
-
|
47 |
-
**Two Excel files are generated:**
|
48 |
-
|
49 |
-
1. **Current Run File**: Contains only the cards from the current session
|
50 |
-
2. **Total Database File**: Contains ALL cards ever processed (cumulative)
|
51 |
-
|
52 |
-
Each business card creates one row in the Excel file with columns for:
|
53 |
-
- filename
|
54 |
-
- processed_date
|
55 |
-
- method (AI model used: gemini-2.5-flash or gemini-2.5-pro)
|
56 |
-
- saved_image_path (path to saved image file, if image saving is enabled)
|
57 |
-
- full_name, first_name, last_name
|
58 |
-
- job_title, company, department
|
59 |
-
- emails (comma-separated if multiple)
|
60 |
-
- phones (all types combined, comma-separated if multiple)
|
61 |
-
- address (street and full address combined)
|
62 |
-
- city, state, postal_code, country
|
63 |
-
- website, linkedin
|
64 |
-
- And more...
|
65 |
-
|
66 |
-
## Configuration
|
67 |
-
|
68 |
-
### Environment Variables
|
69 |
|
70 |
-
|
71 |
-
-
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
-
|
74 |
-
1. Go to your Space settings
|
75 |
-
2. Add a new secret named `Gemini_API`
|
76 |
-
3. Set the value to your Google Gemini API key
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
82 |
|
83 |
-
|
84 |
-
```bash
|
85 |
-
# Copy the example file
|
86 |
-
cp env.example .env
|
87 |
-
# Then edit .env with your actual API key
|
88 |
-
```
|
89 |
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
- **Log File**: `business_card_extractor.log` (created automatically)
|
94 |
-
- **Console Output**: Real-time logging to terminal
|
95 |
-
- **Log Levels**: INFO for general progress, DEBUG for detailed operations
|
96 |
-
- **Coverage**: Every processing step, API calls, file operations, and errors
|
97 |
|
98 |
-
|
99 |
-
-
|
100 |
-
-
|
101 |
-
- Tracking processing performance
|
102 |
-
- Identifying problematic business cards
|
103 |
|
104 |
-
##
|
105 |
|
106 |
-
|
107 |
-
Business_Cards_analyzer/
|
108 |
-
βββ app.py # Main Gradio application
|
109 |
-
βββ requirements.txt # Python dependencies
|
110 |
-
βββ env.example # Environment variables template
|
111 |
-
βββ setup_hf_space.md # Hugging Face deployment guide
|
112 |
-
βββ prompts/ # AI prompts for data extraction
|
113 |
-
β βββ prompt.txt
|
114 |
-
β βββ system_prompt.txt
|
115 |
-
βββ business_card_exports/ # Output Excel files
|
116 |
-
βββ business_cards/ # Saved business card images (optional)
|
117 |
-
βββ .gitkeep # Ensures directory exists
|
118 |
-
```
|
|
|
1 |
+
---
|
2 |
+
title: Business Card Data Extractor
|
3 |
+
emoji: πΌ
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: "4.44.0"
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
|
12 |
+
# Business Card Data Extractor πΌ
|
13 |
|
14 |
+
An AI-powered tool that extracts structured data from business card images using Google's Gemini AI. Upload business card images and get organized data exported to Excel files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
## Features
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
- **Batch Processing**: Process multiple business cards at once (up to 5 per batch)
|
19 |
+
- **AI Model Selection**: Choose between Gemini 2.5 Flash (fast) or Gemini 2.5 Pro (accuracy)
|
20 |
+
- **Excel Export**: Get data in two formats:
|
21 |
+
- Current session results
|
22 |
+
- Cumulative database (appends across sessions)
|
23 |
+
- **Smart Data Extraction**: Extracts name, company, title, emails, phones, address, website
|
24 |
+
- **Image Storage**: Option to save uploaded images with timestamps
|
25 |
|
26 |
+
## How to Use
|
|
|
|
|
|
|
27 |
|
28 |
+
1. **Set API Key**: Add your Google Gemini API key as `Gemini_API` environment variable
|
29 |
+
2. **Upload Images**: Select up to 5 business card images
|
30 |
+
3. **Choose Model**: Select Gemini model (Flash for speed, Pro for accuracy)
|
31 |
+
4. **Process**: Click "Extract Business Card Data"
|
32 |
+
5. **Download**: Get Excel files with extracted data
|
33 |
|
34 |
+
## Supported Data Fields
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
- **Name**: Full name from business card
|
37 |
+
- **Company**: Company/organization name
|
38 |
+
- **Title**: Job title/position
|
39 |
+
- **Emails**: Email addresses (comma-separated if multiple)
|
40 |
+
- **Phones**: Phone numbers (comma-separated if multiple)
|
41 |
+
- **Address**: Full address information
|
42 |
+
- **Website**: Company website URL
|
43 |
+
- **Processing Info**: Timestamp, model used, filename
|
44 |
|
45 |
+
## Requirements
|
|
|
|
|
|
|
|
|
46 |
|
47 |
+
- Google Gemini API key
|
48 |
+
- Image formats: JPG, JPEG, PNG, WEBP
|
49 |
+
- Maximum file size: 10MB per image
|
|
|
|
|
50 |
|
51 |
+
## API Usage
|
52 |
|
53 |
+
This app uses Google's Gemini AI for intelligent text extraction from business card images. Batch processing reduces API costs by processing multiple cards in a single request.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|