alexneakameni commited on
Commit
855ec97
Β·
verified Β·
1 Parent(s): 693596e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +123 -1
README.md CHANGED
@@ -10,4 +10,126 @@ pinned: false
10
  short_description: Cameroon Card ID Counter
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  short_description: Cameroon Card ID Counter
11
  ---
12
 
13
+ # Voter Card Verification System
14
+
15
+ ## Overview
16
+
17
+ This project is a web-based application for verifying voter card numbers using machine learning and database storage. Users upload an image of their voter card along with the card number. The application uses GroqCloud's LLM to verify:
18
+
19
+ 1. If the provided number appears on the card.
20
+ 2. If the card is of Cameroonian origin (by checking for the presence of "Cameroun" on the card).
21
+
22
+ If the verification is successful, the card number is saved in a local SQLite database.
23
+
24
+ ## Features
25
+
26
+ * **Image and Text Verification** : Validates the voter card number and checks the origin of the card using GroqCloud's LLM with vision capabilities.
27
+ * **Database Integration** : Stores verified card numbers in a SQLite database, ensuring uniqueness.
28
+ * **User-Friendly Interface** : Provides an intuitive interface built with Gradio for easy interaction.
29
+
30
+ ## Installation and Setup
31
+
32
+ ### Prerequisites
33
+
34
+ 1. Python 3.8 or later.
35
+ 2. Required Python packages:
36
+ * `gradio`
37
+ * `pillow`
38
+ * `sqlite3` (part of Python's standard library)
39
+ * `groq` (GroqCloud Python SDK)
40
+ * `base64` (part of Python's standard library)
41
+
42
+ ### Steps
43
+
44
+ 1. Clone this repository:
45
+ ```bash
46
+ git clone https://github.com/your-repo/voter-card-verification.git
47
+ cd voter-card-verification
48
+ ```
49
+ 2. Install the required packages:
50
+ ```bash
51
+ pip install -r requirements.txt
52
+ ```
53
+ 3. Set up your GroqCloud API key:
54
+ * Add your GroqCloud API key as an environment variable:
55
+ ```bash
56
+ export GROQ_API_KEY="your-api-key"
57
+ ```
58
+ * Specify the model ID as an environment variable:
59
+ ```bash
60
+ export GROQ_MODEL_ID="llama-3.2-11b-vision-preview"
61
+ ```
62
+ 4. Run the application:
63
+ ```bash
64
+ python app.py
65
+ ```
66
+
67
+ ## How It Works
68
+
69
+ 1. **Initialization** :
70
+
71
+ * A SQLite database (`voter_cards.db`) is created to store voter card numbers.
72
+ * The GroqCloud client is initialized using the API key.
73
+
74
+ 1. **User Interaction** :
75
+
76
+ * Users upload an image of their voter card and enter the card number in the Gradio interface.
77
+ * The image is converted to a base64-encoded string to send to the GroqCloud LLM.
78
+
79
+ 1. **Verification** :
80
+
81
+ * The GroqCloud LLM is queried to check if:
82
+ 1. The provided number appears on the card.
83
+ 2. The card contains the word "Cameroun" to confirm its origin.
84
+ * The model responds with `true` if both conditions are met; otherwise, it responds with `false`.
85
+
86
+ 1. **Database Storage** :
87
+
88
+ * If verification succeeds, the card number is stored in the SQLite database. Duplicate entries are prevented.
89
+
90
+ 1. **Output** :
91
+
92
+ * Users receive feedback on whether the verification succeeded or failed.
93
+
94
+ ## Project Structure
95
+
96
+ ```
97
+ voter-card-verification/
98
+ β”‚
99
+ β”œβ”€β”€ app.py # Main application file
100
+ β”œβ”€β”€ requirements.txt # Python dependencies
101
+ β”œβ”€β”€ voter_cards.db # SQLite database (auto-created on first run)
102
+ └── README.md # Project documentation
103
+ ```
104
+
105
+ ## Usage
106
+
107
+ 1. Open the application in your browser after launching it.
108
+ 2. Upload an image of your voter card.
109
+ 3. Enter the voter card number.
110
+ 4. View the result of the verification.
111
+
112
+ ## Notes
113
+
114
+ * Ensure the uploaded image is clear and readable.
115
+ * This application is tailored for verifying voter cards specific to Cameroon.
116
+
117
+ ## Future Enhancements
118
+
119
+ * Integration with Firebase for cloud-based storage.
120
+ * Improved OCR fallback for local verification.
121
+ * Support for additional countries and card types.
122
+
123
+ ## License
124
+
125
+ This project is licensed under the MIT License. See the `LICENSE` file for details.
126
+
127
+ ## Acknowledgments
128
+
129
+ * [GroqCloud](https://www.groq.com/) for their advanced LLM capabilities.
130
+ * [Gradio](https://www.gradio.app/) for the user-friendly web interface.
131
+
132
+ ---
133
+
134
+ For any questions or issues, feel free to open an issue in the repository.
135
+