JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q32108F
  • License MIT

a pure js convert a base64 to a tensor object for node

Package Exports

  • base64-to-tensor
  • base64-to-tensor/dist/convert.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (base64-to-tensor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

base64-to-tensor

pure js convert a base64 image to tensor

Installation

npm i base64-to-tensor --save

Getting Started

Make sure to have @tensorflow/tfjs-core installed.

import { convert } from "base64-to-tensor";

const tensor = convert(mybase64);

Why

The benefits of using pure js to calc the image is in a couple areas:

  1. size and portablity required is drastically less since you do not need cairo or any of the native img dev converters.
  2. speed is also faster since the calcs are done at hand without needing to bridge any calls.
  3. can use tensors in worker threads - profit allows for properly using Tensorflow wasm backends in an API service 🥳.