Let’s process an image to extract structured data:
Copy
from vlmrun.client import VLMRun# Initialize the clientclient = VLMRun()# Process an image from a URLresponse = client.image.generate( urls=["https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.invoice/invoice_1.jpg"], domain="document.invoice")# Check if processing completedif response.status == "completed": # Access the structured data invoice = response.response print(f"Invoice #: {invoice.invoice_number}") print(f"Total: ${invoice.total_amount}")
# Extract data from a PDFresponse = client.document.generate( url="https://storage.googleapis.com/vlm-data-public-prod/hub/examples/document.form/form_1.pdf", domain="document.form")