Coder Social home page Coder Social logo

vaimdev / porcupyne Goto Github PK

View Code? Open in Web Editor NEW

This project forked from outoflaksh/porcupyne

0.0 0.0 0.0 28 KB

Image-to-text microservice to easily and effectively extract text from a given image. Built with Tesseract, FastAPI & Docker. ๐Ÿš€

Home Page: https://porcupyne.onrender.com

Shell 1.88% Python 87.89% Dockerfile 10.23%

porcupyne's Introduction

Porcupyne

Image-to-text OCR microservice built with Python using FastAPI and Tesseract
View Docs ยท Report Bug ยท Request Feature

Table of Contents
  1. About The Project
  2. Usage
  3. Getting Started
  4. Contributing

About The Project

Porcupyne is an image-to-text microservice, powered by Google Tesseract OCR, that can be easily incorporated in any application via a simple-to-use API built with FastAPI. The whole microservice is containerized using Docker, making it easier for anyone to set up a local copy and bend it to their needs.

The microservice also cleans and processes the uploaded images with OpenCV; improving the OCR predictions of the Tesseract model.

Built With

(back to top)

Usage

It's extremely easy to use the Porcupyne OCR service. One simply needs to upload an image file they want converted via an HTTP POST request to https://porcupyne.herokuapp.com/convert/ and a JSON response with the results obtained after applying OCR will be recieved back.

The request body will be of the form of a multipart form.

You can use your preffered API client to test it out. Example Python usage is also provided below:

  python3 -m pip install requests
  import requests

  url = "https://porcupyne.onrender.com/convert"
  img_path = "/downloads/img.png"
  files = {"file": open(img_path, "rb")}

  response = requests.post(url, files=files)

  if response.status_code == 200:
    print(response.json())

Output:

{
	"results": {
		"raw": "It was the best of\ntimes, it was the worst\nof times, it was the age\nof wisdom, it was the\nage of foolishness...\n\f",
		"cleaned": "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness...",
		"lines": [
			"It was the best of",
			"times, it was the worst",
			"of times, it was the age",
			"of wisdom, it was the",
			"age of foolishness...",
			"\f"
		]
	}
}

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Install Docker. Instructions can be found here in the official docs.

Installation

  1. Clone the repo
    git clone https://github.com/outoflaksh/porcupyne.git
  2. Change into the base directory.
    cd porcupyne
  3. Build the Docker image.
    docker build -t porcupyne .
  4. Run the Docker container.
    docker run porcupyne

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

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.