ak-ml18 commited on
Commit
6ac1aaa
·
verified ·
1 Parent(s): 2d85a8e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +85 -0
README.md CHANGED
@@ -10,4 +10,89 @@ pinned: false
10
  short_description: This Model helps to extract text from inputted images.
11
  ---
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
10
  short_description: This Model helps to extract text from inputted images.
11
  ---
12
 
13
+ # OCR Web Application
14
+
15
+ This is a web application built using Gradio and Hugging Face Transformers for Optical Character Recognition (OCR). The application can extract text from images, support multiple languages, and highlight specified keywords.
16
+
17
+ ## Table of Contents
18
+ - [Prerequisites](#prerequisites)
19
+ - [Setup Instructions](#setup-instructions)
20
+ - [Running the Application Locally](#running-the-application-locally)
21
+ - [Deployment Process](#deployment-process)
22
+ - [Model Description](#model-description)
23
+
24
+ ## Prerequisites
25
+
26
+ Make sure you have the following installed on your machine:
27
+
28
+ - Python 3.6 or higher
29
+ - pip (Python package installer)
30
+
31
+ ## Setup Instructions
32
+
33
+ 1. **Clone the Repository**:
34
+
35
+ Clone this repository to your local machine using the following command:
36
+
37
+ git clone <repository-url>
38
+ cd <repository-name>
39
+
40
+
41
+ Create a Virtual Environment (Optional but Recommended):
42
+
43
+ It is recommended to create a virtual environment to manage your dependencies.
44
+
45
+ python -m venv ocr-env
46
+ source ocr-env/bin/activate # On Windows use: ocr-env\Scripts\activate
47
+
48
+
49
+ Install Required Libraries:
50
+
51
+ Use the following command to install the required libraries:
52
+
53
+ pip install -r requirements.txt
54
+
55
+ Running the Application Locally
56
+
57
+ To run the web application locally, execute the following command in your terminal:
58
+
59
+ python app.py
60
+
61
+
62
+
63
+ ##Deployment Process
64
+ Once I was satisfied with the functionality of my web application, I decided to deploy it to make it accessible to others. Here’s how I did it:
65
+
66
+ Choose a Deployment Platform: I opted for Hugging Face Spaces because it allows easy deployment for machine learning applications. However, other platforms like Streamlit Sharing or Heroku could also work.
67
+
68
+ Clone the Repository: First, I cloned my project repository from GitHub or any other version control platform I was using. This ensured I had all the latest code on my local machine.
69
+
70
+ bash
71
+ Copy code
72
+ git clone https://github.com/username/OCR_Model.git
73
+ Set Up Environment Variables: If my application required any sensitive information or API keys, I made sure to set those up in environment variables on the deployment platform.
74
+
75
+ Requirements File: I created a requirements.txt file that listed all the necessary libraries:
76
+
77
+ plaintext
78
+ Copy code
79
+ gradio
80
+ transformers
81
+ Pillow
82
+ requests
83
+ torch
84
+ tensorflow
85
+ tf-keras
86
+ This file would ensure that the platform installs all the dependencies needed to run the application.
87
+
88
+ Deployment Configuration: On Hugging Face Spaces, I navigated to the "Create a Space" option and selected the "Gradio" template. I uploaded my code and the requirements.txt file to the space. The platform automatically detects the required libraries and installs them.
89
+
90
+ Running the Application: After the upload, I clicked on the "Run" button. The Hugging Face platform handles the execution of my application. I could see real-time logs, which helped in debugging if anything went wrong during the startup process.
91
+
92
+ Testing: Once the application was running, I accessed the URL provided by Hugging Face to test its functionality. I made sure everything was working as expected before sharing it with others.
93
+
94
+ Sharing: After confirming that the application was live and functional, I shared the link with friends, colleagues, and any potential users to gather feedback and improve the application.
95
+
96
+ By following these steps, I successfully deployed my web application, making it accessible for anyone interested in using my OCR model.
97
+
98
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference