npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datafire/microsoft_cognitiveservices_ocr

v3.0.0

Published

DataFire integration for Computer Vision Client

Downloads

2

Readme

@datafire/microsoft_cognitiveservices_ocr

Client library for Computer Vision Client

Installation and Usage

npm install --save @datafire/microsoft_cognitiveservices_ocr
let microsoft_cognitiveservices_ocr = require('@datafire/microsoft_cognitiveservices_ocr').create({
  apim_key: ""
});

.then(data => {
  console.log(data);
});

Description

The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively.

Actions

BatchReadFile

Use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read File interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'GetReadOperationResult' operation to access OCR results.​

microsoft_cognitiveservices_ocr.BatchReadFile({
  "body": {
    "url": ""
  }
}, context)

Input

Output

Output schema unknown

GetReadOperationResult

This interface is used for getting OCR results of Read operation. The URL to this interface should be retrieved from 'Operation-Location' field returned from Batch Read File interface.

microsoft_cognitiveservices_ocr.GetReadOperationResult({
  "operationId": ""
}, context)

Input

  • input object
    • operationId required string: Id of read operation returned in the response of the 'Batch Read File' interface.

Output

RecognizeText

Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation.

microsoft_cognitiveservices_ocr.RecognizeText({
  "mode": "",
  "body": {
    "url": ""
  }
}, context)

Input

  • input object
    • mode required string (values: Handwritten, Printed): Type of text to recognize.
    • body required ImageUrl

Output

Output schema unknown

GetTextOperationResult

This interface is used for getting text operation result. The URL to this interface should be retrieved from 'Operation-Location' field returned from Recognize Text interface.

microsoft_cognitiveservices_ocr.GetTextOperationResult({
  "operationId": ""
}, context)

Input

  • input object
    • operationId required string: Id of the text operation returned in the response of the 'Recognize Text'

Output

Definitions

BoundingBox

  • BoundingBox array: Quadrangle bounding box, with coordinates in original image. The eight numbers represent the four points (x-coordinate, y-coordinate from the left-top corner of the image) of the detected rectangle from the left-top corner in the clockwise direction. For images, coordinates are in pixels. For PDF, coordinates are in inches.
    • items number

ComputerVisionError

  • ComputerVisionError object: Details about the API request error.
    • code required string (values: InvalidImageFormat, UnsupportedMediaType, InvalidImageUrl, NotSupportedFeature, NotSupportedImage, Timeout, InternalServerError, InvalidImageSize, BadArgument, DetectFaceError, NotSupportedLanguage, InvalidThumbnailSize, InvalidDetails, InvalidModel, CancelledRequest, NotSupportedVisualFeature, FailedToProcess, Unspecified, StorageException): The error code.
    • message required string: A message explaining the error reported by the service.
    • requestId string: A unique request identifier.

ImageUrl

  • ImageUrl object
    • url required string: Publicly reachable URL of an image.

Line

  • Line object: An object representing a recognized text line.
    • boundingBox BoundingBox
    • text string: The text content of the line.
    • words array: List of words in the text line.

OperationStatus

  • OperationStatus string (values: NotStarted, Running, Failed, Succeeded): Status code of the text operation.

ReadOperationResult

  • ReadOperationResult object: OCR result of the read operation.

TextOperationResult

TextRecognitionResult

  • TextRecognitionResult object: An object representing a recognized text region
    • clockwiseOrientation number: The orientation of the image in degrees in the clockwise direction. Range between [0, 360).
    • height number: The height of the image in pixels or the PDF in inches.
    • lines required array: A list of recognized text lines.
    • page integer: The 1-based page number of the recognition result.
    • unit string (values: pixel, inch): The unit used in the Width, Height and BoundingBox. For images, the unit is 'pixel'. For PDF, the unit is 'inch'.
    • width number: The width of the image in pixels or the PDF in inches.

Word

  • Word object: An object representing a recognized word.
    • boundingBox required BoundingBox
    • confidence string (values: High, Low): Qualitative confidence measure.
    • text required string: The text content of the word.