1.0.0 • Published 1 year ago

image-to-embedding v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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\

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.