A OCR/HCR based API for recognizing code snippets, notes, and other academic content from images, built using Microsoft's Cognitive Services and Google's Cloud Vision API.
You can test out the Text Recognition API by following any of the steps below:
To see the full capabilities of the API, visit https://text-recognition-api-v2.herokuapp.com/api/annotate
OR
docker run -d -p 3000:3000 jsam07/text-recognition-api:latest
OR
Clone this repository:
git clone [email protected]:jsam07/text-recognition-api.git
Install npm dependencies:
cd text-recognition-api
npm install
npm run dev
The server is now running on http://localhost:3000. You can now perform API requests, e.g. http://localhost:3000/api/annotate. You can always visit https://text-recognition-api-v2.herokuapp.com/api/annotate for a demo of the API.
Note, running the application locally or via Docker will require environment variables with the following shape:
AZURE_API_KEY=""
AZURE_COGNITIVE_ENDPOINT=""
GOOGLE_ACCOUNT_TYPE=""
GOOGLE_PROJECT_ID=""
GOOGLE_PRIVATE_KEY_ID=""
GOOGLE_PRIVATE_KEY=""
GOOGLE_CLIENT_EMAIL=""
GOOGLE_CLIENT_ID=""
GOOGLE_AUTH_URI=""
GOOGLE_TOKEN_URI=""
GOOGLE_AUTH_CERT_URL=""
GOOGLE_CLIENT_CERT_URL=""You can access the REST API using the following endpoints:
/api/annotate: Annotate/Analyze demo image
/api/annotate: Annotate/Analyze image for text/code- Body:
image: String(required): The base64 string of the image to processcode: Boolean(optional): If image is code snippet or not
- Body:
- Starter from: BCIT-DDC API Starter. Underlying logic of this application is different from the former.