Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
[![npm version](https://img.shields.io/npm/v/deepai.svg?style=flat-square)](https://www.npmjs.org/package/deepai)
Simple Javascript Client Library for Deep AI's APIs from Browser and Node.js
Node.js or other environments using npm:
npm install --save deepai
Browser:
<script src="https://cdnjs.deepai.org/deepai.min.js"></script>
Most examples are for Content Moderation, but you can subsitute any model name available at DeepAI.
Ensure that you pass the correct input names. Not all model input names are "image". You can find the correct input name on the page for each model at DeepAI.org
All examples use Async-Await syntax, so ensure you run the code in an async function.
// Ensure you load deepai with one of the methods in "Installation"
deepai.setApiKey('YOUR_API_KEY'); // get your free API key at https://deepai.org
Pass URL:
var result = await deepai.callStandardApi("content-moderation", {
image: "https://YOUR_IMAGE_URL"
});
Pass Literal Text:
var result = await deepai.callStandardApi("sentiment-analysis", {
text: "I am very happy to play with the newest APIs!"
});
Pass Image DOM Element:
var result = await deepai.callStandardApi("content-moderation", {
image: document.getElementById('yourImageId')
});
Pass File Picker Element:
var result = await deepai.callStandardApi("content-moderation", {
image: document.getElementById('yourFilePickerId')
});
This code will render the result of the API call into an existing HTML element, such as a div, with the id "yourResultContainerId".
The result will fit itself inside your container, so be sure to set a size on it.
var result = await deepai.callStandardApi("content-moderation", {
image: "https://YOUR_IMAGE_URL"
});
await deepai.renderResultIntoElement(result, document.getElementById('yourResultContainerId'));
The function renderAnnotatedResultIntoElement is for advanced users only.
var resultAnnotated = {
output_url: <Pass URL of the model output>
output: <Pass the model output directly in case of JSON or text output>
id: "fa616aa1-c762-4c98-b44e-75781627974a" <pass your job ID>
inputs:[
{
is_img: true,
url: (relative or absolute img url, annotations will be rendered on top of this result url.)
}
],
visualizer_data: {
list_key: 'Objects', (Name of the list property containing annotations)
label_key: 'Object' (Name of the value property to label annotations with)
},
scale_applied: 1.333 (Scale to multiply all detection x y coordinates by before rendering)
};
deepai.renderAnnotatedResultIntoElement(resultAnnotated, document.getElementById('yourResultContainerId'));
const deepai = require('deepai');
deepai.setApiKey('YOUR_API_KEY'); // get your free API key at https://deepai.org
Pass URL:
var result = await deepai.callStandardApi("content-moderation", {
image: "https://YOUR_IMAGE_URL"
});
Pass Literal Text:
var result = await deepai.callStandardApi("sentiment-analysis", {
text: "I am very happy to play with the newest APIs!"
});
Pass File Upload:
const fs = require('fs');
<...>
var result = await deepai.callStandardApi("content-moderation", {
image: fs.createReadStream('/path/to/your/file.jpg')
});
npm install
npm run-script build
FAQs
[![npm version](https://img.shields.io/npm/v/deepai.svg?style=flat-square)](https://www.npmjs.org/package/deepai) [![CodeQL](https://github.com/deepai-org/deepai-js-client/actions/workflows/codeql.yml/badge.svg)](https://github.com/deepai-org/deepai-js-cl
We found that deepai 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.