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

@smart-cloud/image-review

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@smart-cloud/image-review

Typescript Image Review Client by Smart Cloud Solutions Inc.

unpublished
latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

TypeScript Image Review client by Smart Cloud Solutions

TypeScript client for the Image Review App by Smart Cloud Solutions Inc..

📋 Introduction

The Image Review client provides a seamless way to interact with the Image Review App, allowing tolling operators or image review companies to process and review images efficiently. This client supports features like license plate, make and model, and dangerous goods recognition.

💻 Prerequisites

Before installing, ensure you have the following prerequisites:

Node.js (>=12.0.0) npm (>=6.0.0)

💁 How to Install

npm install --save @smart-cloud/image-review

📖 Usage

For basic usage, see the example below. For detailed instructions and more examples, please visit the Getting Started guide.

🚘 Single Image Processing

import {
  ImageReviewServiceClient,
  Image,
  SearchRequest,
  SearchResponse,
} from "@smart-cloud/image-review";
import { credentials } from "@grpc/grpc-js";
import { readFileSync } = from "fs";

/*
Create a client instance.
The first parameter is the address of the Docker-based Image Review application or a load-balancer in front of it in a clustered environment, in the format HOST:PORT. Here, HOST is the hostname or IP address and PORT is the exposed TCP port of the application, e.g., 127.0.0.1:8080.
If the application is listening over TLS, use `credentials.createSsl()` instead of `credentials.createInsecure()`.
*/
const client = new ImageReviewServiceClient(
  "127.0.0.1:8080",
  credentials.createInsecure()
);

// Create a search request
const searchRequest = new SearchRequest();
// Enable make and model recognition
searchRequest.setMakeAndModelRecognition(true);
// Set image name and bytes
const fileName = "path/to/image/file";
const imageData = readFileSync(fileName);
searchRequest.setImage(new Image().setData(imageData).setName(fileName));

// Send the request to the application
const call = client.search(searchRequest);

// Handle the response
call.on("data", (response: SearchResponse) => {
  switch (response.getStatus()) {
    case "QUEUEING":
      console.log("Request queued.");
      break;
    case "PROCESSING":
      console.log("Request processing.");
      break;
    case "RESULT":
      console.log('Search Result:', response.getResultList());
      break;
  }
});

call.on("end", () => {
  console.log("Search ended.");
});

call.on("error", (err) => {
  console.error("Search error:", err);
});

More examples can be found on the Getting Started page.

Keywords

anpr

FAQs

Package last updated on 16 Jul 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