0.0.1-security • Published 3 months ago

web-ai-51pwn v0.0.1-security

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

web ai 51pwn, node 20.4.0

Install

yarn upgrade --latest
yarn add web-ai-51pwn

Usage

Import module

// 安装纯净版 JavaScript。这是性能最慢的选项。
yarn add @tensorflow/tfjs
// 有gpu的时候这样安装最快
npm install @tensorflow/tfjs-node-gpu

import yolo from 'web-ai-51pwn';

Initialize and load model

// <script src="dist/charset.js"></script>
var charset4ai = true;
import yolo from 'web-ai-51pwn';


// Use default models (stored in my GitHub demo repo)
let myYolo = await yolo.v1tiny();
let myYolo = await yolo.v2tiny();
let myYolo = await yolo.v3tiny();
let myYolo = await yolo.v3();

// or specify path or handler, see https://js.tensorflow.org/api/0.13.3/#loadModel
let myYolo = await yolo.v3tiny("https://.../model.json");

// or use frozen model, see https://js.tensorflow.org/api/0.13.3/#loadFrozenModel
let myYolo = await yolo.v3tiny(
  "https://.../weights_manifest.json",
  "https://.../tensorflowjs_model.pb"
);

Run model

Supported input html element:

  • img
  • canvas
  • video
const boxes = await myYolo.predict(canvas);

// Optional settings
const boxes = await myYolo.predict(
  canvas,
  {
    maxBoxes: 5,          // defaults to 20
    scoreThreshold: .2,   // defaults to .5
    iouThreshold: .5,     // defaults to .3
    numClasses: 80,       // defaults to 80 for yolo v3, tiny yolo v2, v3 and 20 for tiny yolo v1
    anchors: [...],       // See ./src/config.js for examples
    classNames: [...],    // defaults to coco classes for yolo v3, tiny yolo v2, v3 and voc classes for tiny yolo v1
    inputSize: 416,       // defaults to 416
  }
);

Output box format

{
  top,    // Float
  left,   // Float
  bottom, // Float
  right,  // Float
  height, // Float
  width,  // Float
  score,  // Float
  class   // String, e.g. person
}

Dispose model

myYolo.dispose();
0.0.1-security

3 months ago

1.2.12

6 months ago

1.2.13

6 months ago

1.2.11

6 months ago

1.2.16

6 months ago

1.2.17

6 months ago

1.2.14

6 months ago

1.2.15

6 months ago

1.2.10

8 months ago

1.2.9

9 months ago

1.2.8

9 months ago

1.2.7

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago