Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paddlejs-mediapipe/data-processor-simplify

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paddlejs-mediapipe/data-processor-simplify

data processor of Paddle.js

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

English

@paddlejs-mediapipe/data-processor

A npm package which provide APIs about dataProcessing in Paddle.js.

npm

npm install @paddlejs-mediapipe/data-processor

Usage

import { genFeedData, nj } from '@paddlejs-mediapipe/data-processor';

const options = {
    targetShape: [1, 3, 224, 224], // required
    mean: [0.5, 0.5, 0.5],
    std: [1, 1, 1],
    colorType: 0, // 0: rgb; 1: bgr; default 0
    normalizeType: 0 // data normalize type: 0: 0~1; 1:-1~1; default 0
};

// Array data that the length should match the targetShape in options.
const data = Array.from(new Array(3 * 224 * 224), () => 244);
const feedData = genFeedData(data, options);

// use numjs
const numData = nj.array([1, 2, 3, 4], 'float32');
const reshapedData = nj.reshape(numData, [2, 2]);
const transposedData = nj.transpose(1, 0);
const flattenedData = transposedData.flatten();

FAQs

Package last updated on 18 Apr 2022

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