Coder Social home page Coder Social logo

image2table's Introduction

OCR Image Processing

This project processes images to extract text using OCR and converts the text into structured data in a CSV format.

Setup

Prerequisites

  • Python 3.12.3+
  • Tesseract OCR
  • GitHub Account
  • Git

Creating a GitHub Account

  1. Visit the GitHub Signup Page
  2. Fill in the required details (username, email, password) and complete the sign-up process.
  3. Verify your email address by clicking on the verification link sent to your email.

Installing Git

Windows

  1. Download Git for Windows from the official website: git-scm.com
  2. Run the installer and follow the instructions.
  3. Verify the installation:
    git --version

macOS

  1. Install Homebrew if you haven't already:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install Git:
    brew install git
  3. Verify the installation:
    git --version

Linux (Ubuntu)

  1. Update the package list:
    sudo apt update
  2. Install Git:
    sudo apt install git
  3. Verify the installation:
    git --version

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/ocr-image-processing.git
    cd ocr-image-processing
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Ensure Tesseract is installed and the TESSDATA_PREFIX environment variable is set:

    export TESSDATA_PREFIX=/usr/local/share/tessdata/

Installing Python and Pip

Windows

  1. Download Python from the official website: python.org
  2. Run the installer and follow the instructions, ensuring to check the box to add Python to your PATH.
  3. Verify the installation:
    python --version
    pip --version

macOS

  1. Install Homebrew if you haven't already:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install Python:
    brew install python
  3. Verify the installation:
    python3 --version
    pip3 --version

Linux (Ubuntu)

  1. Update the package list:
    sudo apt update
  2. Install Python:
    sudo apt install python3 python3-pip
  3. Verify the installation:
    python3 --version
    pip3 --version

Usage

  1. Place the images to be processed in the data/images directory.

  2. Run the main script with the images directory and output directory as arguments:

    python src/main.py data/images data/output
  3. The processed CSV files will be saved in the specified output directory.

Example CLI Usage

python src/main.py data/images data/output

Using CI/CD with GitHub Actions

This project uses GitHub Actions for CI/CD. When you push images to the master branch, the GitHub Actions workflow will automatically process the images and upload the CSV outputs as artifacts.

  1. Push Images to GitHub:

    git add data/images/
    git commit -m "Add new images"
    git push origin master
  2. Download CSV Outputs:

    • Go to the Actions tab in your GitHub repository.
    • Select the latest workflow run.
    • Scroll down to the Artifacts section.
    • Download the csv-files artifact.

Example Screenshots

GitHub Actions Workflow Run

GitHub Actions Workflow

Downloading Artifacts

Download Artifacts

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

image2table's People

Contributors

rotemlevi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.