Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
azure-cognitiveservices-vision
Advanced tools
Microsoft Azure Cognitive Services Vision API Client Library for Node.js
This project provides a Node.js rollup package that makes it easy to work with the Microsoft Azure Cognitive Services Vision APIs. Right now it supports:
npm install azure-cognitiveservices-vision
const msRestAzure = require('ms-rest-azure');
const CognitiveServicesManagement = require("azure-arm-cognitiveservices");
let client;
let createAccount = msRestAzure.interactiveLogin().then((credentials) => {
client = new CognitiveServicesManagement(credentials, suite.subscriptionId);
return client.accounts.create('groupname', 'accountname', {
sku: {
name: "F0"
},
kind: "ComputerVision",
location: "westus",
properties: {}
});
}).catch((err) => {
console.log('An error ocurred');
console.dir(err, {depth: null, colors: true});
});
let serviceKey;
createAccount.then((result) => {
return client.accounts.listKeys('groupname', 'accountname');
}).then((result) => {
serviceKey = result.key1;
console.log(result.key2);
}).catch((err) => {
console.log('An error ocurred');
console.dir(err, {depth: null, colors: true});
});
const CognitiveServicesCredentials = require('ms-rest-azure').CognitiveServicesCredentials;
// Creating the Cognitive Services credentials
// This requires a key corresponding to the service being used (i.e. text-analytics, etc)
let credentials = new CognitiveServicesCredentials(serviceKey);
const vision = require('azure-cognitiveservices-vision');
let client = new vision.ComputerVisionAPIClient(credentials);
let fileStream = fs.createReadStream('pathToSomeImage.jpg');
client.analyzeImageInStreamWithHttpOperationResponse(fileStream, {
visualFeatures: ["Categories", "Tags", "Description"]
}).then((response) => {
console.log(response.body.tags);
console.log(response.body.description.captions[0]);
}).catch((err) => {
throw err;
});
let fileStream = fs.createReadStream('pathToSomeImage.jpg');
client.face.detectInStreamWithHttpOperationResponse(fileStream, {
returnFaceId: true,
returnFaceAttributes: 'age,gender,headPose,smile,facialHair,glasses,emotion,hair,makeup,occlusion,accessories,exposure,noise'
}).then((httpResponse) => {
console.log(httpResponse.response.body);
}).catch((err) => {
throw err;
});
https://azure.microsoft.com/en-us/try/cognitive-services/ under "Vision"
2017.04.03 version 2.0.0-preview
FAQs
Microsoft Azure Cognitive Services Vision API Client Library for Node.js
The npm package azure-cognitiveservices-vision receives a total of 2 weekly downloads. As such, azure-cognitiveservices-vision popularity was classified as not popular.
We found that azure-cognitiveservices-vision demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.