rongo1 commited on
Commit
595f63f
Β·
1 Parent(s): 29d41e1

fix: FIXED README

Browse files
Files changed (1) hide show
  1. README.md +41 -106
README.md CHANGED
@@ -1,118 +1,53 @@
1
- # Business Card Data Extractor
 
 
 
 
 
 
 
 
 
2
 
3
- A Gradio-based application that extracts contact information from business card images using Google's Gemini API and exports the data to Excel.
4
 
5
- ## Features
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
- 4. Click "Process Business Cards"
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
- Set the following environment variable:
71
- - `Gemini_API`: Your Google Gemini API key
 
 
 
 
 
72
 
73
- #### For Hugging Face Spaces:
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
- #### For Local Development:
79
- ```bash
80
- export Gemini_API="your_api_key_here"
81
- ```
 
82
 
83
- Or create a `.env` file:
84
- ```bash
85
- # Copy the example file
86
- cp env.example .env
87
- # Then edit .env with your actual API key
88
- ```
89
 
90
- ## Logging
 
 
 
 
 
 
 
91
 
92
- The application includes comprehensive logging:
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
- Logs help with:
99
- - Debugging extraction issues
100
- - Monitoring API usage
101
- - Tracking processing performance
102
- - Identifying problematic business cards
103
 
104
- ## File Structure
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.