Update README.md
Browse files
README.md
CHANGED
@@ -36,63 +36,66 @@ Make sure you have the following installed on your machine:
|
|
36 |
|
37 |
git clone <repository-url>
|
38 |
cd <repository-name>
|
|
|
|
|
39 |
|
40 |
|
41 |
-
|
|
|
42 |
|
43 |
-
It is recommended to create a virtual environment to manage your dependencies.
|
44 |
|
45 |
-
|
46 |
-
source ocr-env/bin/activate # On Windows use: ocr-env\Scripts\activate
|
47 |
|
|
|
48 |
|
49 |
-
Install Required Libraries:
|
50 |
|
51 |
-
|
|
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
58 |
|
59 |
-
|
60 |
|
|
|
61 |
|
|
|
62 |
|
63 |
-
|
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 |
-
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
89 |
|
90 |
-
Running the Application
|
91 |
|
92 |
-
Testing
|
93 |
|
94 |
-
Sharing
|
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
|
|
|
36 |
|
37 |
git clone <repository-url>
|
38 |
cd <repository-name>
|
39 |
+
|
40 |
+
2. **Create the virtual environment**:
|
41 |
|
42 |
|
43 |
+
python -m venv ocr-env
|
44 |
+
source ocr-env/bin/activate # On Windows use `ocr-env\Scripts\activate`
|
45 |
|
|
|
46 |
|
47 |
+
3. **Install the Required Libraries**:
|
|
|
48 |
|
49 |
+
pip install -r requirements.txt
|
50 |
|
|
|
51 |
|
52 |
+
## Running the Application locally
|
53 |
+
To run the web application on your local machine, execute the following command in your terminal:
|
54 |
|
55 |
+
python app.py
|
56 |
|
57 |
+
## Deployment Process
|
58 |
|
59 |
+
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:
|
60 |
|
61 |
+
**1. 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.
|
62 |
|
63 |
+
**2. 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.
|
64 |
|
65 |
+
git clone https://github.com/username/OCR_Model.git
|
66 |
|
67 |
+
**3. 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.
|
|
|
68 |
|
69 |
+
**4. Requirements File**: I created a requirements.txt file that listed all the necessary libraries:
|
70 |
|
71 |
+
-gradio
|
72 |
+
-transformers
|
73 |
+
-Pillow
|
74 |
+
-requests
|
75 |
+
-torch
|
76 |
+
-tensorflow
|
77 |
+
-tf-keras
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
This file would ensure that the platform installs all the dependencies needed to run the application.
|
80 |
|
81 |
+
**5. Deployment Configuration**: On Hugging Face Spaces, I navigated to the "Create a Space" option and selected the "Gradio" template. I uploaded my code as app.py and the requirements.txt file to the space. The platform automatically detects the required libraries and installs them.
|
82 |
|
83 |
+
**6. 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.
|
84 |
|
85 |
+
**7. 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.
|
86 |
|
87 |
+
**8. 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.
|
88 |
|
89 |
By following these steps, I successfully deployed my web application, making it accessible for anyone interested in using my OCR model.
|
90 |
|
91 |
+
## Contributing
|
92 |
+
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|