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


# 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"

# 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)

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.3.tar.gz (2.9 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.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ocr-genai-beta-0.1.3.tar.gz
  • Upload date:
  • Size: 2.9 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.3.tar.gz
Algorithm Hash digest
SHA256 c7c6accb764238f5f1ac02fe47d5c1378ed91e7bfdb384c7df717c58145b7b3f
MD5 00154afdb59e904a2c4523bdb62dc3cd
BLAKE2b-256 1845d6b940bdc42845b6e04795f55664a70f3f2dae3d0624bddf69ca40038997

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ocr_genai_beta-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0e38c292b1618c1550e8a2c7eea26576d04d54431113f68acd22bbf505ec0d8b
MD5 2a6c7cf698b5e597e5bbec71e5db63b9
BLAKE2b-256 2d4b3592121b9fb65f29968b509878e1bed2a45a55ee2fe6a102c2087405d5af

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