A web application that allows users to upload an image and convert it to text using Optical Character Recognition (OCR) technology. This application supports user authentication and provides a user-friendly interface for image uploads and text extraction.
- User authentication (Registration, Login, Logout)
- Upload image and convert it to text
- Display extracted text
- Responsive design for mobile and desktop screens
- Python 3.x
- Flask
- SQLite
- EasyOCR
- Pillow
- Werkzeug
-
Clone the repository:
git clone https://github.com/minnukota381/flask-ocr-app.git cd flask-ocr-app
-
Create a virtual environment:
python -m venv venv venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the project root and add your secret key:SECRET_KEY=your_secret_key_here
-
Set up the SQLite database:
python -c "from app import create_connection; create_connection()"
-
Run the Flask application:
flask run
-
Open the app in your browser: Navigate to
http://127.0.0.1:5000
in your web browser.
-
Register or Login:
- If you are a new user, register an account.
- If you already have an account, log in.
-
Upload an Image:
- Click the "Choose File" button to select an image from your device.
- Click "Convert" to upload the image and extract text.
-
View Extracted Text:
- The extracted text from the uploaded image will be displayed in the text area.
flask-ocr-app/
│
├── app.py # Main application file
├── requirements.txt # Python dependencies
├── Procfile # For deployment (Heroku)
├── templates/
│ ├── index.html # Main HTML file
│ ├── login.html # Login HTML file
│ └── register.html # Register HTML file
├── static/
│ ├── stylesheets/
│ │ └── login.css # CSS for login page
│ │ └── register.css # CSS for register page
│ │ └── index.css # CSS for main page
│ └── images/
│ └── scripts/
│ └── index.js # JavaScript for client-side interactions
└── .env # Environment variables
└── README.md # This README file
- Backend: Flask
- Frontend: HTML, CSS, JavaScript
- OCR Engine: EasyOCR
- Image Processing: Pillow
- Database: SQLite
- Authentication: Werkzeug
- Deployment: Heroku
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes and commit them (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.