Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 992 Bytes

ReadME.MD

File metadata and controls

38 lines (26 loc) · 992 Bytes

Getting Started

Installation

Using npm:

The NPM package is available in the following respoitory. Use the following command to install the repository locally.

npm i line-segmentation-algorithm-to-gcp-vision

Usage in Node.js

Input via a JSON file

const fs = require("fs");
const algorithm = require("line-segmentation-algorithm-to-gcp-vision");

// Load the JSON file which has the GCP Response
const content = fs.readFileSync("./S01200HQT173.jpg.json");
// Parse the JSON fine to a variable
const textJson = JSON.parse(content);

// Perform Line Segmentation
console.log(algorithm.initLineSegmentation(textJson[0]['responses'][0]));

Use the response from GCP results

const algo = require("line-segmentation-algorithm-to-gcp-vision");

// call GCP Vision and retrieve results
let gcpResponse = {};
console.log(algo.initLineSegmentation(gcpResponse[0]['responses'][0]));