Skip to main content

Automatic Graph Classification and Data Extraction

Project description

GraphVision AI 📊👁️

GraphVision AI is a lightweight, powerful computer vision library for automatic graph classification and structured data extraction.

Built with PyTorch and EasyOCR, it is designed to look at an image of a chart, instantly recognize what kind of graph it is, and extract its labels and values into a clean, developer-friendly JSON format.


✨ Key Features

🚀 Zero-Configuration

Models and weights are automatically downloaded from Hugging Face the first time you run it. No manual weight management required.

🧠 Intelligent Routing

Automatically classifies the input image (Pie, Vertical Bar, Horizontal Bar, Line, etc.) and routes it to the correct extraction algorithm.

🖼 Robust Input Handling

Pass a file path (String), an OpenCV image (NumPy array), or a PIL Image directly into the analyzer.

🔍 Smart OCR Masking

Uses contrast filtering and spatial mapping to accurately match text labels with their corresponding graphical data points.


📦 Installation

Install directly from PyPI:

pip install graphvision-ai

🚀 Quick Start

Extracting data from a graph takes less than 5 lines of code:

from graphvision.extractor import GraphExtractor

try:
    # 1. Initialize your engine (this will download weights if needed)
    vision_engine = GraphExtractor()
    
    # Path to your test image
    image_to_test = "hbar2.png" 
    
    # 2. Run the extraction using the new method name
    print(f"\n🚀 Extracting data from {image_to_test}...")
    result_json_string = vision_engine.extract(image_to_test)
    
    # 3. Print the result (it's already a nicely formatted string!)
    print("\n✅ Extraction Successful!")
    print(result_json_string)

except Exception as e:
    print(f"\n❌ Error during testing: {e}")

📄 Example Output

{
    "type": "pie",
    "title": "Favorite Programming Languages",
    "data": {
        "Python": 45.2,
        "JavaScript": 25.1,
        "C++": 15.4,
        "Java": 14.3
    }
}

📈 Supported Graph Types

Currently, GraphVision AI supports high-accuracy extraction for:

  • pie — Pie Charts
  • vbar_categorical — Vertical Bar Charts
  • hbar_categorical — Horizontal Bar Charts

Line and Dot-Line charts coming soon.

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

graphvision_ai-0.2.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

graphvision_ai-0.2.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file graphvision_ai-0.2.1.tar.gz.

File metadata

  • Download URL: graphvision_ai-0.2.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graphvision_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d40b4ab2e6ea8c95bd309f7c44ebd34c0bc0057335f0c89ec4ab160c5f54a8f3
MD5 46c502eaead0b9a8593c706c3ab9eb8e
BLAKE2b-256 1c5f932e54b3b8565e66ea129fe0cf8c568d0b6d5318c54e93629eabd8ecc9a2

See more details on using hashes here.

File details

Details for the file graphvision_ai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: graphvision_ai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for graphvision_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dfe65ac3d24cc0be69b776270e8e7716fd398253237bee2614bdaab8eadd6074
MD5 6210c9cc9e341fc9749022e0632320be
BLAKE2b-256 da49a15f385fad56c7eda19e84cb834d3e1e68afc99f4b626268c3f14d0e8b5d

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