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 Chartsvbar_categorical— Vertical Bar Chartshbar_categorical— Horizontal Bar Charts
Line and Dot-Line charts coming soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphvision_ai-0.2.2.tar.gz.
File metadata
- Download URL: graphvision_ai-0.2.2.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73a0151424d6e9e413e99118b4e9a2ed0f4fd6fd6c6cdda615aca0a0d1a57bbe
|
|
| MD5 |
4ae579107c67bf97d6e985ab22b49426
|
|
| BLAKE2b-256 |
b4fa6d0dac573b0f966e5a47a9a66d71adbebbcfbadda7d429b92cd26e390218
|
File details
Details for the file graphvision_ai-0.2.2-py3-none-any.whl.
File metadata
- Download URL: graphvision_ai-0.2.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a61e7b41dad9bcc97c9fc24a76ae92cddeb5e3fa93a65da82fdd9a86426fd6e
|
|
| MD5 |
396c197d21ffaad76b17b9625e5b1d25
|
|
| BLAKE2b-256 |
3e48c025aa154c44d04970c6512729b328003351277d812f561b75daa1fce888
|