New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nest-excalibur/google-cloud-vision

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nest-excalibur/google-cloud-vision

Google Cloud Vision module for NestJS framework

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Google Cloud Vision

Installation

npm i @nest-excalibur/google-cloud-vision --save

Import module: GoogleCloudVisionModule : Installation

import { GoogleCloudVisionModule } from '@nest-excalibur/google-cloud-vision/lib';
 
@Module({
    imports: [
        GoogleCloudVisionModule,
    ],
})
export class SomeModule {
}

Don't forget to export your google-cloud credentials before start the server.

Inject the GoogleCloudVisionService in your controller

 import { GoogleCloudVisionService } from '@nest-excalibur/google-cloud-vision/lib';

@Controller('some')
export class SomeController {
 
    constructor(
        private readonly googleCloudVisionAService: GoogleCloudVisionService,
    ) {
    }

    @Get('inspect-image')
      @UseInterceptors(
        FileInterceptor('image'),
      )
      async inspectImage(@UploadedFile() imageFile) {
        // Fecth the file and get it's buffer.  
        const imageBuffer = imageFile.buffer;
        // Invoke the respective service methods
        const text = await this.googleCloudVisionAService.detectText(imageBuffer);
        const faces = await this.googleCloudVisionAService.detectFaces(imageBuffer);
        const explictContent = await this.googleCloudVisionAService.detectExplicitContent(imageBuffer);
        const objects = await this.googleCloudVisionAService.detectMultipleObjects(imageBuffer);
        const properties = await this.googleCloudVisionAService.detectProperties(imageBuffer);
        return {
          text,
          faces,
          explictContent,
          objects,
          properties,
        };
      }
    }

Service Methods

Method NameDescriptionParameters
detectLabelsDetects labels that are in the imageimage-url or buffer
detectFacesDetects faces that are in the imageimage-url or buffer
detectPropertiesGets the more representative properties from the image such as the most relevant colorsimage-url or buffer
detectLandMarksDetects places such as names of buildings, monuments, among other things.image-url or buffer
detectLogosDetects all logos that are in the imageimage-url or buffer
detectExplicitContentDetect some type of explicit content in the image such as violence, racism, etc.image-url or buffer
detectMultipleObjectsDetects all objects that are in the image with their respective ubication polygon coordinatesimage-url or buffer
detectTextDetects all text contained in the imageimage-url or buffer
detectHandwrittenTextDetects get handwritten text in an imageimage-url or buffer

Keywords

FAQs

Package last updated on 30 May 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc