Chandra is an OCR model that outputs markdown, HTML, and JSON. It is highly accurate at extracting text from images and PDFs, while preserving layout information.
You can try Chandra in the free playground
here
, or at a hosted API
here
.
Features
Convert documents to markdown, html, or json with detailed layout information
Good handwriting support
Reconstructs forms accurately, including checkboxes
Good support for tables, math, and complex layouts
Extracts images and diagrams, with captions and structured data
from chandra.model import InferenceManager
from chandra.model.schema import BatchInputItem
# Run chandra_vllm to start a vLLM server first if you pass vllm, else pass hf# you can also start your own vllm server with the datalab-to/chandra model
manager = InferenceManager(method="vllm")
batch = [
BatchInputItem(
image=PIL_IMAGE,
prompt_type="ocr_layout"
)
]
result = manager.generate(batch)[0]
print(result.markdown)
With transformers
from transformers import AutoModel, AutoProcessor
from chandra.model.hf import generate_hf
from chandra.model.schema import BatchInputItem
from chandra.output import parse_markdown
model = AutoModel.from_pretrained("datalab-to/chandra").cuda()
model.processor = AutoProcessor.from_pretrained("datalab-to/chandra")
batch = [
BatchInputItem(
image=PIL_IMAGE,
prompt_type="ocr_layout"
)
]
result = generate_hf(batch, model)[0]
markdown = parse_markdown(result.raw)
chandra huggingface.co is an AI model on huggingface.co that provides chandra's model effect (), which can be used instantly with this datalab-to chandra model. huggingface.co supports a free trial of the chandra model, and also provides paid use of the chandra. Support call chandra model through api, including Node.js, Python, http.
chandra huggingface.co is an online trial and call api platform, which integrates chandra's modeling effects, including api services, and provides a free online trial of chandra, you can try chandra online for free by clicking the link below.
datalab-to chandra online free url in huggingface.co:
chandra is an open source model from GitHub that offers a free installation service, and any user can find chandra on GitHub to install. At the same time, huggingface.co provides the effect of chandra install, users can directly use chandra installed effect in huggingface.co for debugging and trial. It also supports api for free installation.