image-to-embedding
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

image-to-embedding

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Convert an image to embeddings

Install

npm install image-to-embedding

Usage

import { convertFromBuffer } from 'image-to-embedding';

const embedding = await convertFromBuffer(someImageBuffer);
//=> Returns Promise<Embedding>

API

convertFromBuffer(input): Promise<Embedding>

imageToConvert

Type: Buffer

The image to convert in the form of a Buffer. See this test for an example.

Embedding

Type: number[][]

See the Embedding type definition here

Embedding is the return type that is an array of number arrays. There are an array of number arrays because of "contextual embedding" - contextual embeddings aim to capture the meaning of a word or phrase in the context of the surrounding words. This is important because the meaning of a word can change depending on the context in which it is used. For example, the word "bank" could refer to a financial institution, or the edge of a river.

Package Sidebar

Install

npm i image-to-embedding

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

11.5 kB

Total Files

9

Last publish

Collaborators

  • siyer22