image-to-embedding
v1.0.0
Published
Convert an image to embeddings
Downloads
1
Maintainers
Readme
image-to-embedding
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.