New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

image-decoder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-decoder

Analyzes objects within an image and returns relevant keywords and text

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Image-to-Text Module

This module performs simple object detection and can also read text, numbers, characters, and barcodes from images. It identifies objects in a given image file and provides a textual description using an internet-based API.

Features:

  • Supports text and barcode recognition.
  • Promise-based API for asynchronous handling.

Usage Instructions:

var imageToTextDecoder = require('image-to-text');

var file = {
  name: 'iphone.jpeg',
  path: './image/'
};

var key = '<KEY>; // Your API key from Cloudsight API (https://cloudsightapi.com)
imageToTextDecoder.setAuth(key);
imageToTextDecoder.getKeywordsForImage(file).then(function(keywords) {
  console.log(keywords);
}, function(error) {
  console.log(error);
});

Example Output

space gray iPhone

Input File

  • Location: ./image/iphone.jpeg

Barcode and Character Recognition Example:

Barcode Example

Output:

Barcode: 0 36000 29145 2

Nike Just Do It logo

File Specifications

  • Object Format: Specify name and path.
    var file = {
      name: 'iphone.jpeg',
      path: './image/'
    };
    
  • Root Path: If only the name is provided, the path is assumed to be the root directory.
    var file = {
      name: 'iphone.jpeg'
    };
    
  • Buffer Content: Include file content as a buffer.
    fs.readFile('./iphone.jpeg', function(err, content) {
      var file = {
        name: 'iphone.jpeg',
        path: './',
        content: content
      };
    });
    
  • String Format: A simple string indicating the file name; path is treated as root.
    var file = 'iphone.jpeg';
    

Keywords

image

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts