Skip to main content

A package for performing OCR and interpreting the output using OpenAI and Gemini models.

Project description

OCR Package

This Python package allows you to perform OCR on images using Tesseract and interpret the results using generative AI models like OpenAI's GPT and Google's Gemini.

Installation

To install the package, use:

pip install ocr_genAI

Usage

from ocr_genai import perform_ocr, interpret_with_openai, interpret_with_gemini,interpret_with_claude



# Replace with your actual image path and API keys
image_path = "image.jpg"  # Ensure this image exists in your directory
openai_api_key = "YOUR_OPENAI_API_KEY"
gemini_api_key = "YOUR_GEMINI_API_KEY"
claude_api_key = "YOUR_CLAUDE_API_KEY"

# Perform OCR
ocr_output = perform_ocr(image_path)
if ocr_output:
    print("OCR Output:\n", ocr_output)

    # Interpret with OpenAI
    openai_response = interpret_with_openai(ocr_output, openai_api_key)
    if openai_response:
        print("OpenAI Response:\n", openai_response)

    # Interpret with Gemini
    gemini_response = interpret_with_gemini(ocr_output, gemini_api_key)
    if gemini_response:
        print("Gemini Response:\n", gemini_response)
    #interpret with Claude
    claude_response = interpret_with_claude(ocr_output, claude_api_key)
        if claude_response:
            print("Claude Response:\n", claude_response)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocr-genai-beta-0.1.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocr_genai_beta-0.1.4-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file ocr-genai-beta-0.1.4.tar.gz.

File metadata

  • Download URL: ocr-genai-beta-0.1.4.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ocr-genai-beta-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d59461bbbe77b8cce45b0efafff82a22befbc745c8a53a25fd70295f8bdcb7dc
MD5 e74a9c2f0ee17d405da82f45a6a922f1
BLAKE2b-256 c784c08210bffa7e1c83e9e3452063c0a4b9955053e7b4e06d1afab946d1f675

See more details on using hashes here.

File details

Details for the file ocr_genai_beta-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ocr_genai_beta-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for ocr_genai_beta-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 721da713b8bb8eed44d629fcebcdd1d270117f108d1194e3fdde3952b06dee6b
MD5 0f195bd11186a35eed676038de84a9f3
BLAKE2b-256 3ade48e158031fa4e84b0946425344c32c9edbb7ec53d9f587c40f91d2cbe413

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page