Thursday, July 30, 2020

Getting Started with Salesforce Einstein Vision OCR - Part 1

What is Einstein OCR?

We all know that OCR is an Optical Character Recognition which can detect and extract text from images. But, what about Einstein OCR?

Einstein OCR provides models that can detect text in an image such as Business cards, Images that contain unformatted data and images that contain data in tables.

In this blog post, we will focus on the Business Card Model. When choosing business card model, Einstein OCR can detect the entity type text such as Person, Organization, Email, Phone, Address, etc...

Sign Up

To get Started with Einstein Vision, you first need to register for an Account (If you don't already have one). 
Go to: https://api.einstein.ai/signup and Click on Sign Up using Salesforce.



Sign Up Einstein Vision
Sign Up


It is quite straight forward after that. If all goes well, you should see a screen with your Einstein Private Key like below. Download the key and keep it safe for later.

Private key
Private Key

Setup

Deploy Salesforce code

Once you have an Einstein Account, we can start the setup. For the next step, you will require some basic developer skills. 

Download this SFDX project from my public github repository: https://github.com/kevanmoothien/einsteinvisionocr

Connect the project to your Organization using SFDX: Authorize an Org option and then deploy all the elements inside the project structure.

Configure Permission for Salesforce App

When everything has been deployed, you can assign the App Einstein OCR to the desired Profile. 

profile assignment
Profile Assignment


Setup Einstein Vision

Configuring Einstein Vision is pretty straight forward, just switch to the Einstein OCR app on your Salesforce and open the Einstein Vision Setup tab

Enter the email address you used to Sign Up (make sure it is the email and not the Salesforce Username; you should find it in the welcome Einstein Mail).
Then use the Upload Files button to upload the private key (einstein_platform.pem file that you downloaded previously)

When saving the setting, you should have a green tick icon on the right hand side of the component to validate that the Account is valid.

Setup Einstein Vision
Setup Einstein Vision


OCR in Action

To see the OCR in action, simply click on the Einstein OCR tab next to the Einstein Vision Setup tab.

Insert a Business Card Image Url and click on Scan.

Demo

The page comprises of 3 simple component: 
  • Component to input the Image Url
  • Another one for Preview the Business Card
  • lastly, result previewer
From the above example, you can see Mark Benioff business card. It has already categorised the different elements found on the Business  Card.

Wrap-Up

If you want to dive into more details on how the API call is done and detection result is processed, you can just take a look at the class EinsteinVisionUtils and Prediction class in the source code. 

4 comments:

  1. Getting a problem where every time I try to change the email address, I'll keep getting an error that says "This page has an error. You might just need to refresh it. First, would you give us some details? (We're reporting this as error ID: -465312255)".

    Technical error says "[NoErrorObjectAvailable] Script error." Any ideas?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Well, this isn't the biggest concern now. I have an error where I get "Uncaught (in promise) TypeError: Cannot read property 'rowIndex' of undefined". The credentials were successfully accepted by the system and I'd like to know why the reader is not completing the task. Any help would be great.

      Delete
  2. The introduction to Einstein OCR provides a helpful overview of how optical character recognition has evolved beyond simple text extraction. The explanation of detecting structured entities such as names, organizations, email addresses, phone numbers, and addresses from business cards demonstrates how AI-powered OCR can significantly streamline data capture and document processing workflows. This makes the technology particularly valuable for CRM systems and business automation applications.

    A notable feature highlighted in the article is the ability of Einstein OCR to identify meaningful entities rather than just extracting raw text from images. By converting visual information into structured and actionable data, the platform enables more intelligent document analysis and integration with enterprise applications. Similar technologies are widely explored in Image Processing Projects For Final Year, where extracting useful information from images is a key objective.

    The business card use case discussed in the article is a great example of how computer vision and text recognition can work together to automate real-world tasks. Accurate extraction of contact information requires both visual understanding and character recognition capabilities, making it an important application area for Image Captioning Projects and related image understanding technologies that transform visual content into structured information.

    ReplyDelete